Markets: A Rigorous Course

Part VI · Prediction and synthesis · M13A · week 8 · 14 h

Cointegration, pairs and statistical arbitrage

Unit roots and spurious regression, Engle–Granger and Johansen, Ornstein–Uhlenbeck estimation and optimal bands, Kalman-filter hedge ratios, structural breaks, and Indian pairs and parity trades.

Builds on M04 Systematic researchM07 Forwards and futuresM10 CommoditiesM13 Forecasting

Prerequisites M13 · 13.2 (AR models, stationarity, half-life), M10 · 10.5 and 10.7 (gold import parity; the OU discretisation (10.18), the half-life (10.19) and the first ADF test on the gold/silver ratio), M07 (futures, basis, rolling), M04 (backtesting, multiple testing, HAC errors). Maths: the functional central limit theorem and the continuous mapping theorem (stated and used, not proved), Itô's lemma and the generator of a diffusion, Gaussian conditioning, projections and Cochran's theorem, generalised eigenproblems. Time: ~14 hours (notes 8 h, problems 4 h, code 2 h). Primary texts: J. D. Hamilton, Time Series Analysis (Princeton, 1994), ch. 13 (Kalman filter), 17 (unit roots), 18–19 (cointegration), 20 (Johansen); S. Johansen, Likelihood-Based Inference in Cointegrated Vector Autoregressive Models (Oxford, 1995), ch. 4–6; E. Chan, Algorithmic Trading (Wiley, 2013), ch. 2–3; W. K. Bertram, "Analytic solutions for optimal statistical arbitrage trading", Physica A 389(11), 2010.

Learning outcomes

  1. Derive the Dickey–Fuller regression from an AR(1) and the augmented form from an AR(pp), derive the limiting distribution of T(ρ^−1)T(\hat\rho-1) and of the DF tt-statistic under a unit root, and explain why the critical values are not Student-tt.
  2. Show analytically and by simulation why regressions of one random walk on another produce large tt-statistics and R2R^2, and state what this implies for "pairs" chosen by correlation.
  3. Define cointegration, prove the Granger representation for a cointegrated VAR(1), run the Engle–Granger two-step test with the correct critical values, and derive Johansen's trace and maximum-eigenvalue statistics from the reduced-rank regression.
  4. Estimate an Ornstein–Uhlenbeck process exactly from its AR(1) form, quantify the bias and imprecision of the estimated speed of mean reversion, and compute half-lives with honest uncertainty.
  5. Derive the expected first-passage times of an OU process and Bertram's expected cycle length, and compute the entry and exit bands that maximise expected profit per unit time after costs.
  6. Compare OLS, reverse-OLS and total-least-squares hedge ratios, and derive the Kalman filter for a random-walk hedge ratio, including its likelihood and steady-state gain.
  7. Derive and apply the Chow test, explain why choosing the break date from the data invalidates it, and use sup-F, CUSUM and Bai–Perron appropriately.
  8. Test Indian pairs (HDFC Bank/ICICI Bank, Nifty/Bank Nifty, MCX gold against COMEX parity, gold/silver) properly, and price the frictions of an Indian stat-arb book: costs, the SLB market, futures as the short leg, and lot sizes.

Sections ≈ 3 h 5 min of study

  • Foundation 4 sections · ≈ 35 min
  • Core 9 sections · ≈ 1 h 30 min
  • Advanced 4 sections · ≈ 1 h
  1. Learning outcomes Foundation 5′
  2. 13A.1 What statistical arbitrage is, and what it is not Foundation 5′
  3. 13A.2 Unit roots and the Dickey–Fuller test Core 15′
  4. 13A.3 Spurious regression Core 5′
  5. Figure Spurious regression between independent random walks
  6. 13A.4 Cointegration and error correction Core 10′
  7. 13A.5 The Engle–Granger two-step Core 10′
  8. 13A.6 Johansen's method: reduced-rank regression Advanced 10′
  9. 13A.7 The Ornstein–Uhlenbeck spread: estimation, half-life and precision Core 10′
  10. 13A.8 Trading bands under OU Advanced 20′
  11. Figure Optimal trading bands for an Ornstein–Uhlenbeck spread
  12. 13A.9 Hedge ratios: OLS, total least squares and the Kalman filter Advanced 15′
  13. Figure Kalman-filter hedge ratio versus rolling OLS
  14. 13A.10 Structural breaks: Chow, sup-F, CUSUM and Bai–Perron Advanced 15′
  15. 13A.11 Risks and frictions of statistical arbitrage in India Foundation 10′
  16. 13A.12 Indian applications, tested Core 15′
  17. Lab Pairs on Indian data: Engle–Granger, half-life and a Kalman hedge ratio
  18. 13A.13 Case studies Core 10′
  19. Summary of key results Foundation 15′
  20. Readings and resources Core 10′
  21. Facts that change Core 5′

Create a free account

Reading is open to everyone. An account keeps your progress, answers, notes and code drafts, and gives you the study plan, the journals and the simulator. Running code needs an account approved for it.