Basic Prerequisites: Econometrics & Time Series (stationarity, unit roots, Engle–Granger cointegration) and Statistics & Inference. (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)


1. Intuition & Practical Objective

Statistical arbitrage (StatArb) is the relative branch of alpha generation. It does not forecast the market’s direction; it forecasts that a relationship between two (or more) assets will hold, and trades only the deviation from that relationship. If two assets share the same nonstationary fundamental driver - Chevron and ExxonMobil, Shell A and Shell B, a stock and its sector ETF, the front and back month of a future - then a linear combination of their prices is stationary, and temporary idiosyncratic flow that pushes it away from equilibrium must eventually be given back.

The economic claim is the Law of One Price and the compensation for enforcing it: a market-neutral book has zero beta to the systematic factors, so its P&L is the idiosyncratic residual being harvested, plus the risk that the residual never returns.

The one-sentence essence. “Model the spread - not the prices - as a stationary, mean-reverting process; trade deviations measured in standard deviations of that spread; size the position so the book is market-neutral; and treat every widening beyond the model as a possible permanent regime change, not a free lunch.”

This folder is a hub. It gives the method lookup below (§2), a single runnable engine that reproduces the numbers (§3), and routes to six sub-pages that walk from raw intuition → the cointegration test → pair selection & hedging → the trading rule & backtest → failure modes → multivariate extensions.


2. Mathematical Ground Truth & Derivations

Quick-Reference Lookup. All formulas are transcribed from Tsay (2010) Ch 8, Hasbrouck (2007) Ch 10, Avellaneda & Lee (2010) and Gatev, Goetzmann & Rouwenhorst (2006); the numbers in the check column were re-executed and reproduced (see §3 and the sub-pages).

Notation: log-prices of two assets; the spread (cointegration residual); (or ) the mean-reversion speed; the half-life; a one-step difference.

QuantityFormulaVerified check
Cointegration (Engle–Granger), EG vs true
Spurious-regression checkADF on ; reject unit root if (5%, )ADF
AR(1) discretisation
Mean-reversion speed/day (true )
Half-life d (true )
OU stationary variance (continuous) (discrete) (hub sim, discrete)
-score (spread signal)entry , exit , stop
Avellaneda–Lee s-score, enter on a 60-day window
Gatev distance metric on normalised pricestop pair
Johansen trace test: ; :
Johansen max-eigen
Portfolio P&L (dollar-neutral)see sub-page 04

Dictionary of “beta”. Regression hedge ratio (OLS of on ) · dollar-neutral -dollars of per $1 of y · Avellaneda residual (idio return). These are three renderings of the same neutrality condition .

Critical caveat. A high return correlation is neither necessary nor sufficient for a tradable stationary spread. Correlation is a property of the returns; cointegration is a property of the levels. Two independent random walks routinely show return correlation while their spread diverges - see 01 · From Zero.


3. Computational Implementation - the method engine

Stdlib only. It reproduces the headline numbers above (Engle–Granger, ADF, OU half-life). The full-size versions - backtest, distance method, Johansen, s-score - live on the sub-pages and were each re-executed.


4. Failure Modes & First-Principles Breakdowns

Signposts - the folder’s failure-mode analysis lives in 05 · Failure Modes & Practice. In one line each:

  1. Correlation mistaken for cointegration. High return correlation with a nonstationary level spread produces a “trade” whose stop-loss never triggers until the position is ruined.
  2. Structural break in the equilibrium. Mergers, index reconstitution, dividend cuts and technological substitution permanently move the pair’s or drift; the spread widens to and stays there. Enforcement of the Law of One Price is not free - Do & Faff (2010) document a ~57% decline in the strategy’s profitability post-1989.
  3. Costs, borrow and crowding. Two legs double the spread cost; short borrow is scarce in exactly the names that diverge; crowded quant books unwind together (August 2007).

5. References

  • Tsay, Ruey S.: Analysis of Financial Time Series (3rd ed., 2010)
  • Hasbrouck, Joel: Empirical Market Microstructure (2007)
  • Avellaneda, Marco & Lee, Jeong-Hyun: “Statistical Arbitrage in the U.S. Equities Market”, Quantitative Finance 10(7), 2010
  • Gatev, Evan, Goetzmann, William N. & Rouwenhorst, K. Geert: “Pairs Trading: Performance of a Relative-Value Arbitrage Rule”, Review of Financial Studies 19(3), 2006
  • Krauss, Christopher: “Statistical Arbitrage Pairs Trading Strategies: Review and Outlook”, Journal of Economic Surveys 31(2), 2017
  • Do, Binh & Faff, Robert: “Does Simple Pairs Trading Still Work?”, Financial Analysts Journal 66(4), 2010

6. Connected Graph Bridges

Beginner: start at 01 · Practitioner: start at 05