Skip to content
All library documents

Testing Cointegration and Modeling Nonstationary Price Series

Article Quant Q&A · Author: Victor

Summary

The document outlines an empirical sequence for assessing whether two price series are cointegrated. First, test each series for a unit root. If both are stationary, model them in levels; if only one is nonstationary, difference that series. If both are integrated of order one, test whether the residuals from a levels relationship are stationary. Stationary residuals support cointegration, while nonstationary residuals indicate a potentially spurious levels regression.

For cointegrated series, the response recommends estimating an error correction model that combines short-run changes with adjustment toward the estimated long-run relationship. If cointegration is not supported, it suggests modeling the variables in first differences. The original question raises a trend in a proposed ETF spread, but the answer does not directly prescribe a test for a zero, constant mean or diagnose that particular series. Its guidance is a general time-series workflow, and model assumptions and test specifications still matter.

Key ideas

  • Test each series for a unit root before testing for cointegration.
  • Cointegration applies when nonstationary series share a stationary long-run residual relationship.
  • A stationary residual supports an error correction model linking short-run changes to long-run adjustment.
  • If the residual remains nonstationary, differencing the series can avoid a spurious levels regression.
  • Cointegration alone does not establish that a spread has a constant zero mean.

Tags

Full text
# Two prices pass the cointegration test but there is a trend. How to check stationarity?


# Two prices pass the cointegration test but there is a trend. How to check stationarity?












Below is a spread built with two ETFs that pass the cointegration test i.e. Adjusted Dickey Fuller, adfTest(type="nc") in R's fUnitRoots with a p-value < 0.01.

The red line is the trendline.

What test can I use to proove that: (1) both securities are cointegrated and (2) they are mean reversing and the mean is constantly 0 (i.e. stationary, not trended)?

Thanks

## Answer by JohnAndrews (score 0, accepted)

https://quant.stackexchange.com/a/3240

Here is an empirical strategy to test for cointegration.

FIRST, check whether both $X_t$ and $Y_t$ contain an unit root.

- If they are both stationary then model $Y_t$ or $X_t$ in levels (and nothing is wrong).

- If one of the two is $I(1)$ (non-stationary for one level), then take differences to ensure stationarity.

- If they are both non-stationary, and hence $I(1)$, then test for co-integration: if the residuals are $I(0)$, then we speak of the presence of cointegration. Estimate then an ECM model ($Y_t = \beta_0 + \beta_1 X_t + \eta_t$ obtaining $\hat{\beta_0}$ and $\hat{\beta_1}$ and using it in: $\Delta Y_t = \Delta X_t'\phi - \psi(Y_{t-1}-\hat{\beta_0} - \hat{\beta_1}X_t) + \varepsilon_t$. When $\varepsilon_t \sim N(0,1)$ then both $\psi$ and $\phi$ are asymptotically valid. if the residuals are $I(1)$ then we speak of spurious regression. In that case you should model both variables by taking the first differences.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.