Cointegration and Error Correction

The price of gold in London and the price of gold in New York each wander like a random walk — neither is forecastable, both drift without bound. Yet the gap between them never runs away: the moment it widens, arbitrageurs buy the cheap one and sell the dear one until it closes. Two individually unpredictable, non-stationary series can be chained together so that a particular combination of them is stable. That tethering is cointegration, and Clive Granger's formalization of it (with Robert Engle) won the 2003 Nobel Prize in economics.

Integrated series and a stationary combination

Recall that a series is I(1) — integrated of order one — if it has a unit root: it is non-stationary, but its first difference is stationary. Ordinarily, any linear combination of two I(1) series is itself I(1) — add two random walks and you get another random walk. Cointegration is the special, measure-zero exception where the wandering cancels:

Intuitively, the two series are driven by a common stochastic trend — a single underlying random walk they both follow — plus their own stationary wobble. Subtract the right multiple of one from the other and the common trend disappears, leaving only the stationary part. Economically it is a leash: the two can each roam anywhere, but they cannot roam far apart.

Wandering together, on a leash

The two upper curves below are each non-stationary — they drift up and down with no fixed mean — yet they never separate, because they share one common trend. The flat lower curve is their spread (the deviation from equilibrium): it wobbles around zero and always returns. That stationary spread is the visible signature of cointegration. If the two series were merely two independent random walks, the gap between them would itself wander off and never come back.

The Vector Error Correction Model

Cointegration reshapes the vector autoregression. Running a VAR on the raw I(1) levels wastes the long-run information; a VAR on the differences throws it away entirely. The right form keeps both — the Vector Error Correction Model (VECM):

\Delta \mathbf{y}_t = \boldsymbol{\alpha}\,\boldsymbol{\beta}^\top \mathbf{y}_{t-1} + \Gamma_1 \Delta \mathbf{y}_{t-1} + \dots + \Gamma_{p-1}\Delta \mathbf{y}_{t-p+1} + \boldsymbol{\varepsilon}_t.

The star of the equation is the error-correction term \boldsymbol{\beta}^\top \mathbf{y}_{t-1} — yesterday's distance from equilibrium. When the spread is positive (the series have drifted too far apart), the loading vector \boldsymbol{\alpha} pushes the changes \Delta\mathbf{y}_t in the direction that shrinks the gap. The matrix \Pi = \boldsymbol{\alpha}\boldsymbol{\beta}^\top is reduced-rank: its rank equals the number of independent cointegrating relationships, and that rank is exactly what the Johansen test estimates.

Drag the adjustment speed below and watch a disequilibrium of size one get pulled back to zero. A larger loading corrects faster; a loading of zero would leave the deviation to wander forever (no cointegration at all).

Worked example: the Engle–Granger two-step

You suspect a stock's spot price y_t and its futures price x_t are cointegrated. Engle and Granger's original recipe is beautifully direct:

One subtlety: because \hat\beta was itself estimated, the ordinary Dickey–Fuller critical values are wrong — you must use the special Engle–Granger critical values, which are further from zero. For more than two series, or to test several cointegrating relations at once, the Johansen maximum-likelihood procedure (based on the rank of \Pi) is the modern default.

Regress one random walk on another, completely unrelated random walk and something alarming happens: you routinely get a large R^2, a t-statistic that screams "significant", and residuals that look meaningful — all describing a relationship that does not exist. Granger and Newbold demonstrated this in 1974 with simulations, and it terrified a generation of economists who had been fitting exactly such regressions on trending macro data. The reason is that ordinary regression theory assumes stationary errors; with I(1) variables the usual t and R^2 distributions simply do not apply. The escape hatch is precisely cointegration: a regression of one I(1) series on another is meaningful only if the two are cointegrated — in which case the residual is stationary and the relationship is real. Otherwise the golden rule is to difference first and model \Delta y. High R^2 plus a low Durbin–Watson statistic is the classic tell-tale of a spurious regression.

A statistical-arbitrage desk hunts for two stocks — historically two oil majors, say — whose prices are cointegrated: individually they follow the market's random walk, but their spread reverts to a stable mean. The strategy writes itself. When the spread stretches unusually wide, short the rich stock and buy the cheap one; when it snaps back to equilibrium, unwind and pocket the convergence. The whole trade is a bet that the error-correction term \boldsymbol{\beta}^\top\mathbf{y}_{t-1} will do its job and pull the pair home. The risk, of course, is that the relationship breaks — a merger, a scandal, a structural shift severs the leash — at which point the "mean-reverting" spread simply walks away, and the position bleeds. Cointegration is a property you must keep re-testing, never assume.