Skip to content
  • Overview
  • Curriculum
    • FLUMental maths and numerical fluency
    • COMBCounting and combinatorics
    • PROBProbability
    • STATStatistics and inference
    • REGRegression and econometrics
    • TSTime series
      • 1Foundations

        • Foundations: stationarity, autocorrelation and the Wold decomposition
      • 2The ARMA family

        • The ARMA family: identification, estimation and forecasting
      • 3Unit roots and cointegration

        • Unit roots, spurious regression and the basis of pairs trading
      • 4Volatility modelling

        • Volatility models: ARCH, GARCH and realised measures
      • 5State space and filtering

        • State space and the Kalman filter
      • 6Financial stylised facts

        • Stylised facts: what financial returns actually look like
      • 7Forecast evaluation

        • Forecast evaluation: walk-forward design and backtest overfitting
    • LALinear algebra
    • SCStochastic calculus
    • MLMachine learning
    • SIGAlpha and signal research
    • CASEResearch case studies

Practise

  • Question bank
  • Mental arithmetic
  • Market simulator
  • Arbitrage trees
  • Horse racing
  • Bid book
  • Screening tests
  • Mock papers

Reference

  • Formula reference
  • Search

Your record

  • Review queue
  • Progress
  • Leaderboard
  • Profile
  • Invite friends
AccountSend feedback
  1. Curriculum
  2. /Quantitative research
  3. /Time series
  4. /Unit roots and cointegration

Unit roots, spurious regression and the basis of pairs trading

TS · Chapter 3·13 min read·Asked at Two Sigma, Citadel, DE Shaw, AQR

After this lesson you should be able to

  • Say why regressing one random walk on another produces nonsense.
  • Define cointegration and distinguish it from correlation.
  • Describe how a pairs trade is estimated and what kills it.

Prices wander; returns do not. Almost every mistake in applied time series comes from running a regression on the first kind of series while reasoning as though it were the second. Cointegration is the precise condition under which a regression on levels *is* legitimate, and it is the statistical content of a pairs trade.

Definition 3.1

Stationarity

Weak stationarity, E[xt]=μ,Cov(xt,xt+h)=γ(h)\mathbb{E}[x_t] = \mu, \quad \mathrm{Cov}(x_t, x_{t+h}) = \gamma(h)E[xt​]=μ,Cov(xt​,xt+h​)=γ(h) — The mean is constant and the covariance depends only on the lag, not on where you are in the sample. A random walk fails this: its variance grows without bound, so it has no mean to revert to and no fixed scale.

0102000.51φ = 1: a random walkφ = 0.9: stationaryPeriods after the shockRemaining effect
Figure 3.2 · What a unit root does to a shock. A shock to a stationary series dies; a shock to a random walk never does. That single difference is why two unrelated walks appear to be related, why the regression of one on the other is spurious, and why the whole of pairs trading rests on finding a combination that decays.

Equation 3.3

The unit root

Stationary when ∣ϕ∣<1|\phi| < 1∣ϕ∣<1; a random walk when ϕ=1\phi = 1ϕ=1. That single boundary separates a series that mean-reverts from one that does not.

xt=ϕ xt−1+εtx_t = \phi\,x_{t-1} + \varepsilon_txt​=ϕxt−1​+εt​
ϕ=1\phi = 1ϕ=1
The unit root. Shocks are permanent and the variance grows linearly in time.
∣ϕ∣<1|\phi| < 1∣ϕ∣<1
Shocks decay with half-life ln⁡(0.5)/ln⁡ϕ\ln(0.5)/\ln\philn(0.5)/lnϕ.

Why spurious regression happens. Take two independent random walks and regress one on the other. You will routinely find a t-statistic above 2 and an R2R^2R2 of 0.3 or more, on data with no relationship whatever. The reason is that the residual is itself a random walk, so it is massively autocorrelated, and the usual standard-error formula assumes it is not — it therefore understates the true uncertainty by an enormous factor. The regression is not detecting a relationship; it is detecting that both series have long, slow swings.

AspectAugmented Dickey–FullerKPSS
Null hypothesisThere is a unit rootThe series is stationary
Rejecting meansThe series is stationaryThere is a unit root
Known weaknessLow power near ϕ=1\phi = 1ϕ=1Sensitive to the lag choice
Good practiceRun both — agreement is more informative than either alone—
Table 3.4 · Testing for a unit root. The nulls are opposite, which is exactly why running both is worthwhile: "ADF fails to reject and KPSS rejects" is a much stronger statement than either result on its own.

The rest of this lesson is in Premium

You have read the opening. 12 more sections follow, including 4 worked examples and 3 quick checks.

Start the free 7-day trialSign in

Nothing is charged for 7 days, and you can cancel before then. Or read The law of large numbers and the central limit theorem in full, free.

← The ARMA family: identification, estimation and forecastingVolatility models: ARCH, GARCH and realised measures →
On this page
  • Stationarity
  • What a unit root does to a shock
  • The unit root
  • Testing for a unit root

QuantMax · 141 lessons · 1342 questions · c5c0caa

  • Premium
  • Arbitrage trees
  • Horse racing
  • Invite friends
  • Account
  • About QuantMax
  • Terms
  • Privacy

Firm names identify publicly reported question patterns and nothing more. QuantMax is not affiliated with, endorsed by, or recruiting for any firm named in the curriculum. Everything you do in lessons and the question bank is kept to your account.