Phillips-Ouliaris Test

The Phillips-Ouliaris Test (PO) is the residual-based test of Phillips and Ouliaris (1990), which corrects the autocorrelation of the residuals nonparametrically, with a long-run variance, as the Phillips-Perron test does for a single series, instead of with lagged differences. It adds two statistics, \(P_{u}\) and \(P_{z}\), that compare the variance of the spread with its long-run variance; \(P_{z}\) does not depend on which ticker is the dependent one.

The formula for the Phillips-Ouliaris Test starts from the residuals \(u_{t}\) of the OLS regression of the dependent on the independent price, \(A_{t} = \alpha + \beta \cdot B_{t} + u_{t}\), and fits a first-order autoregression to them by OLS:

\[u_{t} = \hat{\rho} \cdot u_{t-1} + k_{t}\] \[s_{k}^{2} = \frac{\sum k_{t}^{2}}{n}\]

The statistics \(Z_{t}\) and \(Z_{\alpha}\) correct the t-statistic and the normalised coefficient of that autoregression with the long-run variance \(s_{l}^{2}\) of its residuals \(k_{t}\):

\[Z_{t} = \frac{(\hat{\rho} - 1) \cdot \sqrt{\sum u_{t-1}^{2}}}{s_{l}} - \frac{0.5 \cdot \left(s_{l}^{2} - s_{k}^{2}\right)}{s_{l} \cdot \sqrt{\frac{\sum u_{t-1}^{2}}{n^{2}}}}\] \[Z_{\alpha} = n \cdot (\hat{\rho} - 1) - \frac{0.5 \cdot \left(s_{l}^{2} - s_{k}^{2}\right)}{\frac{\sum u_{t-1}^{2}}{n^{2}}}\]

The variance ratio statistics take the long-run covariance hat(Omega) of the residuals \(\xi_{t}\) of a first-order vector autoregression of the pair \(z_{t}\):

\[z_{t} = c + \Pi \cdot z_{t-1} + \xi_{t}\] \[\omega_{c} = \hat{\omega}_{1,1} - \frac{\hat{\omega}_{1,2}^{2}}{\hat{\omega}_{2,2}}\] \[M = \frac{\sum \left(z_{d,t} \cdot z'_{d,t}\right)}{T}\] \[P_{u} = \frac{n \cdot \omega_{c}}{\frac{\sum u_{t}^{2}}{T}}\] \[P_{z} = n \cdot \text{Tr}\left(\hat{\Omega} \cdot M^{-1}\right)\]

Where \(A_{t}\) and \(B_{t}\) are the two prices, \(z_{t}\) the pair of both, \(z_{d , t}\) the pair demeaned, T the number of observations and \(n = T - 1\), \(s_{l}^{2}\) the Newey-West long-run variance of \(k_{t}\) with truncation lag l, hat(omega_{i,j}) the elements of hat(Omega), \(\omega_{c}\) the long-run variance of the dependent price given the independent one, c and Pi the coefficients of the vector autoregression and Tr the trace. \(Z_{t}\) takes the MacKinnon p-value and critical values of the Engle-Granger Test. \(Z_{\alpha}\) rejects no cointegration below, \(P_{u}\) and \(P_{z}\) above the asymptotic critical values of Phillips and Ouliaris (1990) for one regressor with a constant. The statistics are robust to general autocorrelation of the spread, but like the Phillips-Perron test they are sensitive to strongly negative autocorrelation and to the choice of the truncation lag.

Two individually non-stationary series, such as two stock prices that each follow a random walk, are cointegrated if some linear combination of them is stationary: they share a long-run equilibrium even though each wanders on its own in the short run. This is the statistical foundation of pairs trading. If two assets are cointegrated, the spread between them reverts to its equilibrium level, so the spread itself can be traded, with the slope of the regression of one price on the other as the hedge ratio. A residual-based test of cointegration asks whether the residual of that regression, the spread, has a unit root (no cointegration, the null hypothesis) or is stationary (cointegration, the alternative). The result depends on which ticker is the dependent one, so the two orderings of a pair can disagree; the Johansen test treats the pair without that choice. Cointegration found in one window often breaks down in the next, so a relation is usually tested again on a later sample before it is relied on.

Also known as: PO test, Phillips-Ouliaris cointegration test, Pu, Pz.

In the Finance Toolkit this is get_engle_granger_cointegration with method="phillips_ouliaris", the same function as Engle-Granger Cointegration.

Example · KO, PEP · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_engle_granger_cointegration:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["KO", "PEP"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

cointegration = toolkit.econometrics.get_engle_granger_cointegration(method="phillips_ouliaris")

cointegration[["Phillips-Ouliaris Statistic", "P-Value", "Critical Value 5%", "Cointegrated (5%)"]]

Which returns:

Using Your Own Data

get_engle_granger_cointegration runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:

from financetoolkit import Economics, Econometrics

economics = Economics(start_date="2000-01-01")

unemployment = economics.get_unemployment_rate(
    countries=["United States", "Germany"], period="monthly"
)

econometrics = Econometrics(data=unemployment, changes="difference")

econometrics.get_engle_granger_cointegration()

References

  • Paper MacKinnon, J.G. (1994). “Approximate Asymptotic Distribution Functions for Unit-Root and Cointegration Tests.” Journal of Business & Economic Statistics, 12(2), 167-176.
  • Paper Phillips, P.C.B. and Ouliaris, S. (1990). “Asymptotic Properties of Residual Based Tests for Cointegration.” Econometrica, 58(1), 165-193.
  • Library Referenced against arch’s phillips_ouliaris (Phillips-Ouliaris Test)
Share