This lesson ties the whole module together. Two asset prices can each be a non-stationary random walk, yet move together so closely that a particular combination of them is stationary and mean-reverting. That combination is a cointegrating relationship, and trading its deviations from the mean is the idea behind pairs trading and statistical arbitrage. We start from the spurious regression trap that makes naive level regressions dangerous, define cointegration precisely, run the Engle-Granger test, then work examples by hand: estimating a hedge ratio and spread with least squares, turning that spread into a trade with a z-score and a mean-reversion half-life, and adapting the hedge ratio over time with a Kalman filter. It draws directly on stationarity, the AR(1) from ARIMA, and least squares from the Core ML module.
Table of Contents
Already have an account? Log in!