Cointegration
Cointegration means two non stationary series share a long run relationship. Learn the Engle Granger and Johansen tests, hedge ratios and pairs trading uses.
Two price series can each wander randomly, yet stay tied together over the long run. When a combination of them is stationary, they are said to be cointegrated. Think of a person walking a dog on a long lead: both wander, but they never drift too far apart. Cointegration is the statistical foundation of pairs trading and statistical arbitrage, because it identifies spreads that tend to revert to a stable level. Clive Granger and Robert Engle shared the 2003 Nobel Memorial Prize in Economic Sciences in part for their work on it.
The idea#
If prices X and Y are both non stationary, but there is a coefficient β such that
spread = Y - β × X
is stationary, then X and Y are cointegrated, and β is the cointegrating coefficient (the hedge ratio). See Stationarity, Differencing and Unit Roots.
Correlation vs cointegration#
| Correlation | Cointegration | |
|---|---|---|
| Measures | Co movement of returns, usually short term | Long run relationship between price levels |
| Data used | Returns | Prices |
| High value means | Returns move together | The spread stays bounded and reverts |
| Trading use | Diversification, hedging | Pairs trading, spread trading |
Two stocks can be highly correlated but not cointegrated, drifting apart over time. Two cointegrated stocks can have modest daily correlation but still be pulled back together. See Covariance and Correlation.
The Engle Granger test#
- Regress Y on X (in price levels) to estimate β.
- Calculate the residuals (the spread).
- Test the residuals for stationarity with an ADF test, using special critical values because β was estimated.
The Johansen test#
The Johansen test, developed by Søren Johansen, tests for cointegration among several series at once and can find more than one cointegrating relationship. It is used for baskets, such as a stock against several peers or a group of related futures contracts. See Statistical Arbitrage.
Error correction models#
Cointegrated series can be modelled with an error correction model, where today's changes depend on how far the spread is from equilibrium:
ΔY_t = α × (Y_(t-1) - β X_(t-1)) + other terms + ε_t
A negative α means deviations shrink over time; its size shows how quickly. See Econometrics.
Practical issues#
| Issue | Explanation |
|---|---|
| Relationships break | Mergers, business changes or regulation can end cointegration |
| Look ahead bias | Estimating β on the full sample then trading in the same period inflates results. See Look-Ahead Bias |
| Multiple testing | Testing thousands of pairs finds some cointegrated pairs by chance. See P-Hacking and Multiple Testing |
| Unstable hedge ratios | β can drift; rolling estimates or Kalman filters help |
| Costs and shorting | Borrow fees and trading costs eat small edges. See Borrow Fees and Stock Loan Costs |
Good candidates for cointegration#
- Companies with similar businesses and exposures, such as two large banks or two oil majors.
- Different share classes of the same company.
- ETFs and their underlying baskets.
- Related futures: different delivery locations or closely linked commodities.
- Currency pairs of linked economies (with caution).
Economic reasoning for why the relationship should hold makes results much more trustworthy.
Frequently asked questions#
What is cointegration?#
A property of two or more non stationary series whose combination is stationary, meaning they share a long run relationship and tend to move back together.
What is the difference between correlation and cointegration?#
Correlation measures how returns move together in the short term; cointegration measures whether prices stay tied together over the long run.
How is cointegration used in trading?#
Mainly in pairs trading and statistical arbitrage, where traders buy and sell the spread between cointegrated assets when it moves away from its average.
Next, learn whether one series helps predict another in Granger Causality.
3 quick questions on this lesson. Get them all right to finish it.
Turn on JavaScript to take the quiz.
Mentioned in
- ARIMAMath and Statistics
- EconometricsMath and Statistics
- Online LearningMachine Learning