Skip to content
All library documents

Dynamic Pairs Trading with an Ornstein–Uhlenbeck Mispricing Model

Code Stratmill research code

Summary

The module implements a finite-horizon dynamic allocation approach for a mean-reverting arbitrage spread, drawing on a published model by Jurek and Yang. It constructs total-return indices from two price series, estimates cointegrating spread weights, and fits an Ornstein–Uhlenbeck process to the resulting spread. The estimated long-run mean, reversion rate, and volatility feed an optimal-weight calculation for investors with different preference specifications, including CRRA utility over terminal wealth and an Epstein–Zin case with intermediate consumption.

The code also describes applying training weights to later prices and tracking portfolio wealth, with consumption represented as a deduction in one investor case. The theoretical premise allows convergence timing and the maximum interim divergence to remain uncertain, which makes horizon and divergence risk relevant to allocation. The excerpt is an implementation description rather than empirical validation: it gives no performance results, and warns when the training history is shorter than the period used in the original paper. Cointegration and OU assumptions, estimation choices, and practical trading frictions limit how directly the modeled weights translate into a live pairs trade.

Key ideas

  • The method models a cointegrated spread as an Ornstein–Uhlenbeck process.
  • Spread weights are estimated from total-return indices using cointegration regression.
  • The model estimates a long-run mean, reversion speed, and spread volatility from training data.
  • Optimal allocations depend on investor preferences and remaining horizon.
  • The described implementation provides no performance validation and depends on its modeling assumptions.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.