The Vector Error Correction Model
The regression that lets two cointegrated series drift apart in the short run but always adds a pull back toward their long-run relationship — the engine behind statistical-arbitrage pairs trading.
Prerequisites: Cointegration, Vector Autoregression (VAR)
Two stock prices can each wander like a random walk on their own — no predictable direction, no mean to revert to — and yet the gap between them behaves completely differently: it wanders in the short run but never strays far before snapping back. That combination (individually unpredictable, jointly anchored) is cointegration, and it's the mathematical basis of pairs trading. But cointegration by itself only tells you the relationship exists; it doesn't tell you how fast the gap closes, or how today's gap should adjust tomorrow's prices. The vector error correction model (VECM) is the regression that answers exactly that: it says each series' next move is partly its own short-run wiggle, and partly a correction proportional to how far the pair currently sits from its long-run equilibrium.
An analogy: two dogs on a leash
Picture two dogs on a leash of fixed length, both wandering around a park. Each dog's individual path, watched alone, looks aimless — no destination, no pattern. But the leash means neither dog can wander arbitrarily far from the other: the moment the leash goes taut, there's a pull back. Watch closely and you'll see it's not perfectly symmetric — maybe the smaller dog gets yanked back harder and faster than the bigger one drags forward. That asymmetric pull, proportional to how taut the leash currently is, is exactly the "error correction" term. The VECM measures how taut the leash is right now (the equilibrium error) and how hard each dog gets pulled back per unit of tautness (the adjustment speed).
The model, one symbol at a time
Let and be two cointegrated price series (or a vector of several). First define the equilibrium error, the current gap from the long-run relationship:
In words: ("z sub t-minus-1") is how far apart the pair sat last period, after adjusting for the hedge ratio ("beta") that defines their long-run one-to-one relationship — this is the spread you'd trade. The VECM then models each series' change as:
In words: the change in this period equals an adjustment speed ("alpha sub y") times last period's gap, plus the usual short-run dependence on recent changes in and , plus noise. A parallel equation holds for with its own adjustment speed . The critical quantity is : if is negative and was positive (meaning was too high relative to ), then pushes downward — falls back toward equilibrium. That's the "error correction": a term whose entire job is to shrink last period's disequilibrium.
The VECM splits every move into two parts: ordinary short-run momentum, plus a pull back toward the long-run relationship, sized by how far out of line the pair currently is. The speed of that pull, , is the number that tells you how fast a pairs trade should expect to converge.
Worked example 1: computing the correction term
Stock $102, stock $100, hedge ratio from a prior cointegrating regression. The equilibrium error is — is $2 rich relative to . Suppose the fitted VECM gives and (with short-run terms set to zero for simplicity). Then:
So the model predicts falls by $0.60 and rises by $0.20 next period — the gap shrinks from $2.00 toward $2.00-0.60-0.20 = $1.20, about 60% closed in one step (, since the two moves jointly close of the $1 hedge-adjusted unit... more directly: predicted new gap , a reduction from 2.00, i.e. closed this period). This is a directly tradable prediction: go short , long , and the VECM says the position should profit as the gap mean-reverts, at a rate set by per unit of gap per period.
Worked example 2: half-life from the adjustment speed
If short-run terms are negligible, the gap itself roughly follows , an AR(1)-like decay with persistence . The half-life of the mean reversion is
In words: starting from a $2.00 gap, you'd expect it to shrink to $1.00 in about 1.36 periods, matching the arithmetic above (gap fell from 2.00 to 1.20, about 60% of the way to zero, faster than one full half-life — consistent, since 1.36 periods should get you to exactly half). This half-life is the single most useful number for sizing a pairs trade's holding period: if daily data gives a half-life of 1.4 days, you're running a fast mean-reversion strategy; a half-life of 40 days means much slower, longer-held convergence bets with correspondingly different risk.
Watch how the running quantity in the explorer settles toward a stable value as more steps accumulate — the equilibrium error in a VECM behaves the same way, oscillating but pulled back, rather than drifting off freely like the individual series do.
What this means in practice
- This is pairs trading's engine. The hedge ratio sets the position sizes; the equilibrium error is the entry/exit signal; the adjustment speed tells you the expected holding period and, combined with the spread's volatility, the expected profit per trade.
- You need cointegration first. A VECM only makes sense if and are actually cointegrated — running one on two unrelated random walks manufactures the appearance of mean reversion out of noise, a specific case of spurious regression.
- Adjustment speed can be asymmetric or one-sided. Sometimes only one series does the correcting () — the "weakly exogenous" series leads, the other follows, which matters for deciding which leg to trade more aggressively.
- Compare to a simple OLS spread model. A VECM is strictly richer than just trading the residual from a static cointegrating regression, because it also models the short-run dynamics () that a plain spread z-score ignores.
The classic confusion: fitting a VECM (or trading a "cointegrated" spread) on a pair that was only cointegrated in-sample by chance, or whose relationship has since broken. Cointegration is a structural, economically-grounded relationship (two share classes of the same firm, a commodity and its close substitute) — it is not something you should conclude purely from a passing statistical test on a short backtest window. A VECM fit on a spuriously cointegrated pair will show a plausible-looking negative and a clean half-life right up until the relationship stops holding, at which point the "mean-reverting" spread simply walks away and never comes back.
Related concepts
Practice in interviews
Further reading
- Engle & Granger (1987), Econometrica
- Hamilton, Time Series Analysis, ch. 19-20