How would you test whether two non-stationary stock price series are cointegrated?
answer
- each series wanders, the gap does not
- a linear combination that is stationary
- test the residual spread, not the fit
- estimated residuals need their own critical values
- adjustment coefficient must be negative
basics
~20 sConfirm each series has a unit root, regress one on the other, then test whether the residual spread is stationary using cointegration critical values. If it is, the pair is cointegrated, and step two fits an error-correction model.
solid answer
~50 sCointegration means two individually non-stationary series share a stochastic trend, so some linear combination of their levels is stationary. The Engle-Granger two-step is the standard answer for a pair. First establish that each series is integrated of order one on its own, then run the cointegrating regression of one price on the other and test the residual spread for a unit root — using cointegration critical values, not ordinary unit-root ones, because the residual was fitted to look as stationary as possible. If the residual is stationary, step two estimates the error-correction model: changes in one series regressed on lagged changes of both plus the lagged level gap `y_{t-1} - beta*x_{t-1}`. The coefficient on that gap must be negative; its magnitude is the fraction of the disequilibrium closed each period. For more than two series, or to avoid arbitrarily choosing which one is the regressand, the Johansen procedure tests how many cointegrating relations exist.
go deeper
Be ready to state the definition: two series that each wander, but whose difference or weighted gap stays in a stable band, are cointegrated. Knowing the name of the two-step procedure is enough at this level.
Explain both steps — the levels regression and the stationarity test on its residuals, then the error-correction model — and why the residual test needs its own critical values rather than the standard unit-root ones.
Show the operating judgment: verify the adjustment coefficient's sign and speed, check subsamples for a break that ended the relationship, and treat a screen over many pairs as a multiplicity problem before anything is traded.
Own the risk framing — how much capital or planning may rest on an in-sample equilibrium, what monitoring signals the relationship has broken, and when to retire a model built on a spread that stopped mean-reverting.
## The idea Two series can each wander without a mean and still be tied together. **Cointegration** says that although `y_t` and `x_t` are individually integrated of order one — non-stationary, with a stochastic trend — there exists a coefficient `beta` such that `y_t - beta*x_t` is stationary. The two share the same stochastic trend, and it cancels in that combination. The spread wanders only within bounds and keeps returning toward its own mean. Murray's illustration is the standard one: a drunk walking home and her dog each follow a random path, and neither is going anywhere predictable. But the dog stays within earshot. Each position is a random walk; the *distance between them* is stationary. That distance is the cointegrating combination. The economic version is a pairs trade. If two soft-drink makers face the same input costs, the same consumers and the same sector shocks, their prices may each wander while the spread between them does not. Trading that spread is a bet on cointegration holding. ## Step one: the cointegrating regression Before anything else, establish that each series is I(1) individually — a combination is only interesting if the parts are not already stationary. Then regress one on the other in levels: `y_t = a + beta*x_t + u_t` and keep the residual series `u_t`, the estimated spread. Now test that residual for a unit root. If the residual is stationary, the pair is cointegrated; if the residual itself wanders, you are looking at a spurious regression between two unrelated drifting series. **The critical values are the catch.** You may not use the ordinary unit-root critical values here. Least squares chose `beta` precisely to make the residual variance as small as possible — that is, to make the residual look as stationary as it can — so the test statistic is biased toward rejecting the unit root. Cointegration testing uses its own, more negative critical values, which also depend on how many series are in the regression and on whether a constant or trend was included. Using the wrong table is the single most common error in this procedure and produces cointegration findings that evaporate out of sample. A related subtlety: the answer can depend on which series you put on the left. Least squares minimises errors in one direction only, so regressing `y` on `x` and `x` on `y` need not agree in finite samples. ## Step two: the error-correction model If the residual is stationary, the Granger representation theorem guarantees the pair has an **error-correction** representation, and step two estimates it: `delta_y_t = c + gamma*(y_{t-1} - beta_hat*x_{t-1}) + (lagged delta_y, delta_x terms) + e_t` The bracketed term is last period's disequilibrium — how far the pair sat from its long-run relationship. The coefficient `gamma` is the **speed of adjustment**, and it must be negative: when `y` sits above its equilibrium relation to `x`, the model pulls it back down. A value of `-0.15` on daily data means roughly 15% of any gap is closed per day; the implied half-life of a shock is `ln(0.5) / ln(1 + gamma)` periods. A `gamma` that is statistically zero, or positive, says there is no restoring force, and the cointegration finding should be treated as an artefact. The two-step name comes from estimating `beta` first and treating it as known in step two. That is defensible because the cointegrating regression is *super-consistent* — `beta` converges much faster than an ordinary regression coefficient — but it does mean step two's standard errors ignore the uncertainty in `beta`, which matters in short samples. ## When to reach for Johansen instead Engle-Granger handles one relationship between two series and forces you to pick a regressand. The Johansen procedure works within a vector autoregression in levels, tests **how many** independent cointegrating relations exist among several series, estimates them jointly, and treats all variables symmetrically. For three or more series, or when you want a hypothesis test on the number of relationships, it is the better tool. ## Practical traps - **Multiple testing.** Screening hundreds of pairs and keeping the ones that pass at 5% is a factory for false positives; the count you find must be judged against how many the threshold alone would produce. - **Structural breaks.** A merger, a regulatory change or a shift in business model can end a relationship permanently. A test run over the whole history can pass while the relationship has been dead for a year; check subsamples. - **Nothing here is causal.** Cointegration says two series share a stochastic trend and a restoring force. It does not say one moves the other, and a common third driver is entirely consistent with what you observe. ## Interview framing Say what cointegration is in one sentence, give the two steps, and volunteer the critical-value subtlety and the sign requirement on the adjustment coefficient — those two details are what separate someone who has run the procedure from someone who has read about it.
- Why can't you use ordinary unit-root critical values on the step-one residuals?Because those residuals are not raw data — least squares picked the coefficient that minimises their variance, which is the same as making them look as stationary as possible. The test statistic is therefore biased toward rejecting the unit root, and using the standard table over-rejects. Cointegration tests use their own, more negative critical values, which vary with the number of series and the deterministic terms included.
- What do the sign and size of the error-correction coefficient tell you?The sign must be negative: a positive gap between the series must push the next change downward, otherwise there is no restoring force and the cointegration finding is suspect. The magnitude is the fraction of the disequilibrium closed per period, so `-0.15` on daily data closes about 15% of the gap a day, implying a half-life of `ln(0.5) / ln(0.85)` days, a little over four.
- You screened 500 pairs and 12 tested as cointegrated at the 5% level. What is your reaction?Scepticism. At a 5% threshold, 500 tests on unrelated pairs would be expected to throw up about 25 false passes, so 12 is fewer than chance alone would produce — the screen has found nothing. Any pair-search needs a multiplicity correction, an economic reason to expect a relationship, and confirmation on a held-out period before it is traded.
- When would you use the Johansen procedure instead of Engle-Granger?When there are more than two series, when several cointegrating relations may exist, or when you do not want to arbitrarily choose which variable goes on the left-hand side. Johansen works inside a vector autoregression, treats the variables symmetrically, and provides a test for the number of cointegrating relations rather than assuming there is exactly one.
A drunk walking home and her dog each wander unpredictably, so neither path can be forecast. But the dog stays within earshot, so the distance between them stays in a narrow, mean-reverting band — that distance is the cointegrating combination.
saying these in an interview costs you the question
- Tests the residual with ordinary unit-root critical values
- Calls a high R-squared in the levels regression evidence of cointegration
- Accepts a positive or zero error-correction coefficient
- Skips checking that each series is non-stationary first
- Treats cointegration as proof one series drives the other
- Ignores multiplicity after screening many candidate pairs