Basic Prerequisites: 03 · Forecasting & Unit Roots (unit roots) and Linear Algebra & Matrices (matrix decompositions).
1. Intuition & Practical Objective
Individual asset prices are unit-root processes - but combinations of them need not be. Two prices can each wander without bound while their spread stays in a tight band, pulled back to equilibrium by arbitrage. That shared long-run equilibrium is cointegration, and it is the statistical engine behind pairs trading, index arbitrage, and any strategy that bets on relative value. This page’s objective: model multivariate systems, detect cointegration, and exploit it through the error-correction mechanism (ECM).
The intuition in three steps:
- Two series are cointegrated if a linear combination is (stationary). The number of such independent combinations is the cointegrating rank.
- The Granger Representation Theorem says cointegrated series must move to correct the spread - the ECM with . Long-run equilibrium pins down a relation that nothing in the individual unit-root processes can see.
- Detection is a unit-root test on the spread. Regress on , take the residual, ADF-test it: reject ⇒ cointegrated; fail to reject ⇒ spurious (the trap of 03 · Unit Roots). The Johansen procedure generalizes this to series and estimates the full cointegrating space.
2. Mathematical Ground Truth & Derivations
VAR(p) (Tsay eq. 8.13): , . Stationary iff all eigenvalues of the companion matrix are inside the unit circle. Estimation by OLS (each equation) / ML; order selection by AIC/BIC/HQ; forecasting and orthogonalized impulse-response (Cholesky, ordering-dependent - Tsay §8.2.5).
Cointegration (Tsay §8.5). For a -dimensional series with unit roots: cointegration exists iff , with cointegrating factors; the cointegrating vectors are the columns of with stationary. Example: stationary while each component is .
Error-correction form (Engle–Granger, Tsay eq. 8.33–8.34).
with . The term (the lagged spread) is the “compensation” that avoids over-differencing. Rank of : ⇒ no cointegration; ⇒ is ; with ⇒ cointegrating vectors and common stochastic trends .
Engle–Granger two-step. (1) Regress on , get and residual . (2) ADF-test : stationary ⇒ cointegrated. Then the ECM regresses on the lagged residual with a negative “speed-of-adjustment” coefficient (mean reversion toward ).
Johansen MLE (Tsay §8.6.2). From two auxiliary regressions get residual covariances , then solve the generalized eigenproblem ; cointegrating vectors = leading eigenvectors. Tests:
- Trace: - rank vs ;
- Max-eigenvalue: - rank vs .
Both have nonstandard (Brownian-motion-functional) critical values. Tsay’s interest-rate example (TB3m/TB6m weekly): VAR(3) by BIC, trace vs 95% CV - rejects rank 0 strongly, one cointegrating vector , ECM .
Threshold cointegration (Tsay §8.7) - corrected 3-regime reading. The S&P 500 futures/cash basis model is a three-regime threshold ECM (regimes , , with ): the error-correction/cointegration term is active in the two outer regimes (arbitrage active, past transaction-cost threshold) and insignificant in the middle no-arbitrage band where prices behave like a random walk. (Not “2-regime” - the middle band is regime-free of cointegration.)
Pairs trading (Tsay §8.8). Two similar-risk (e.g. same-industry) stocks are cointegrated; the spread is stationary around mean ; the ECM is with of opposite signs. Portfolio (long 1 share of stock 1, short of stock 2) has return : enter at , unwind at (needs cost), net profit .
PCA/factors (Tsay Ch 9) - the statistical factor side: eigenvalues of (or correlation ); PCs , , cumulative variance . Factor model , . (Full treatment: Fundamental Multi-Factor Models.)
3. Computational Implementation - Engle–Granger cointegration in action
Simulate a cointegrated pair (a common random-walk trend , then , stationary spread), run the Engle–Granger residual ADF, and estimate the ECM speed-of-adjustment. Contrast with two independent random walks (spurious). Stdlib only.
The Engle–Granger procedure recovers the true hedge ratio and rejects the residual’s unit root hard ( vs ): the pair is cointegrated. The ECM coefficient is - each period the spread closes ~43% of its gap toward equilibrium. The control (two independent random walks) fails the residual ADF (), exactly the spurious case - the only difference between “tradeable pair” and “statistical mirage” is this residual test.
4. Failure Modes & First-Principles Breakdowns
- Spurious cointegration from data-snooping. If you screen many pairs for the best-trading one using in-sample tests, you overstate cointegration - the same selection bias ESL Ch 7 warns about for CV. Pairs must be chosen by economic logic (similar-risk peers) and validated out-of-sample, not by hunting the biggest in-sample t-stat.
- Scaling & deterministic-spec sensitivity. Cointegration tests are sensitive to how the series are scaled and to the assumed deterministic terms (no constant / restricted const / drift / trend - Tsay §8.6.1’s five cases). A wrong spec flips the verdict.
- The 3-regime trap (corrected). Real arbitrage is band-threshold: the ECM coefficient is ~0 in the no-arbitrage middle band and only significant in the outer regimes. Estimating a single linear ECM ignores transaction costs and makes the relationship look weaker than it is.
- Impulse-response ordering dependence. In a VAR, Cholesky-orthogonalized impulse responses depend on variable ordering (Tsay §8.2.5) - never report one ordering’s “causality” as if it were invariant.
- Cointegrating vectors are not unique. Any rotation of is also valid (identifying constraint ); interpreting “the” cointegrating vector requires economic theory, not the test.
5. References
- Tsay, Analysis of Financial Time Series
- Engle, R.F. & Granger, C.W.J. (1987), “Co-integration and Error Correction: Representation, Estimation, and Testing,” Econometrica
- Johansen, S. (1991), “Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models,” Econometrica
- Granger, C.W.J. (1987), representation theorem
6. Connected Graph Bridges
- Back: 03 · Forecasting & Unit Roots · Index Hub
- Forward: 06 · Advanced Extensions (multivariate vol, state-space)
- Applied: Stat-Arb & Pairs Trading · Fundamental Multi-Factor Models · Black–Litterman