Welcome to The Deep End. This is Episode four hundred thirty-eight: Statistical Arbitrage, Cointegration, and Regime-Switching Signals: Ornstein-Uhlenbeck Mean Reversion, Johansen Cointegration, Hidden Markov Regimes, and the August 2007 Quant Quake. Picture Manhattan on the morning of Tuesday, August seventh, two thousand seven. If you look at a Bloomberg terminal tracking the macro indices on Tuesday, August seventh and Wednesday, August eighth, two thousand seven, the world looks remarkably calm: - The S&P five hundred index is slightly up. - Credit spreads, Treasury yields, foreign exchange, and the VIX volatility index are barely moving. Yet inside the glass towers of every major quantitative equity market-neutral and statistical arbitrage hedge fund on Earth—Morgan Stanley's Process Driven Trading (PDT), Goldman Sachs Global Alpha and Global Equity Opportunities (GEO), Renaissance Institutional Equities Fund, Highbridge Statistical Opportunities, D. E. Chapters 00:00:00 Chapter 1: Cold Open — Tuesday, August 7 to Thursday, August 9, 2007: When Every Statistical Arbitrage Desk on Wall Street Suffered a 12-Sigma Crash in a Calm Market! 00:05:02 Chapter 2: From Morgan Stanley's 1980s Pairs Trading (Tartaglia & Bamberger) to Gatev-Goetzmann-Rouwenhorst (2006) and Do-Faff-Hamza's (2006) Critique! 00:12:25 Chapter 3: The Ornstein-Uhlenbeck (OU) Stochastic Process — Exact SDE Integration, Equilibrium Variance $\sigma{\text{eq}}^2 = \frac{\sigma^2}{2\kappa}$, Half-Life $t{1/2} = \frac{\ln 2}{\kappa}$, and the Avellaneda-Lee $s$-Score! 00:23:16 Chapter 4: Engle-Granger (1987) Two-Step Cointegration and Augmented Dickey-Fuller (ADF) Testing — And Why OLS Order Asymmetry Breaks Multi-Leg Baskets! 00:31:07 Chapter 5: Søren Johansen's (1988/1991) Vector Error Correction Model (VECM) — Matrix Rank $\text{rank}(\boldsymbol{\Pi}) = r$, $\boldsymbol{\Pi} = \boldsymbol{\alpha}\boldsymbol{\beta}^T$, Canonical Correlations, and the Trace & Max-Eigenvalue Tests! 00:44:16 Chapter 6: Cross-Sectional Statistical Arbitrage via PCA Eigenportfolios vs. Sector ETFs — Avellaneda & Lee (2008/2010) and Trading-Time Volume Clocks! 00:53:56 Chapter 7: Hidden Markov Models (HMMs) and James Hamilton's (1989) Regime-Switching Filter — How to Detect When a Mean-Reverting Spread Switches Into a Trending / Breakdown Regime! 01:04:34 Chapter 8: State-Space Kalman Filtering for Time-Varying Hedge Ratios $\boldsymbol{\beta}t$ and Stochastic Residual Spreads (Do, Faff, & Hamza 2006)! 01:11:43 Chapter 9: Optimal Entry, Exit, and Stop-Loss Thresholds for Ornstein-Uhlenbeck Spreads — First-Passage Time Theory and Bertram / Tim Leung Analytical Optimal Stopping! 01:18:12 Chapter 10: Forensic Anatomy of the August 2007 Quant Quake (Part 1) — Khandani & Lo's (2007) Lo-MacKinlay Contrarian Microscope and the Secular Alpha Compression From 1995 to 2007! 01:23:58 Chapter 11: Forensic Anatomy of the August 2007 Quant Quake (Part 2) — Day-by-Day Reconstruction of August 6–10, 2007, Cross-Market Contagion, and Why PCA Beat ETFs by 2x! 01:30:33 Chapter 12: Crowding Diagnostics, Endogenous Liquidity Risk, and Kill-Switch Engineering After August 2007! 01:35:34 Chapter 13: End-to-End Quantitative Production Case Study — Building a Multi-Asset Statistical Arbitrage & Cointegration Engine from Scratch! 01:42:43 Chapter 14: Synthesis and Statistical Arbitrage Engineer's Checklist — And What Comes Next in Episode 439! Created by Sankalp Thakur. A Transient Labs production. Website: https://transientlabs.ai GitHub: https://github.com/sankalpsthakur X / Twitter: https://x.com/sankalpsthakur LinkedIn: https://www.linkedin.com/in/sankalpthakur/ Hugging Face: https://huggingface.co/sankalpsthakur Scripts generated with Claude Opus. Synthetic narration generated with Kokoro. Reviewed, listened to, and approved by Sankalp Thakur.