The Ornstein-Uhlenbeck (OU) process is the mathematical heart of QuanterLab's stochastic mean-reversion module. It models a series that drifts toward a long-run mean with a known speed, perturbed by Gaussian noise. If you understand OU, you understand most of what SC001STCB does.
The Definition
OU is a continuous-time stochastic process satisfying:
Three parameters with concrete meanings:
- μ (mu) — the long-run mean. The level the process drifts toward.
- θ (theta) — the mean-reversion speed. Larger θ → faster pull toward μ.
- σ (sigma) — the volatility of the noise term.
The term θ × (μ − X(t)) × dt is the deterministic pull toward the mean: when X is above μ the pull is downward, when X is below μ the pull is upward. The term σ × dW(t) is Gaussian noise that constantly perturbs the path.
The expected time for the process to return halfway to the mean from any deviation is ln(2) / θ ≈ 0.693 / θ. This "half-life" is the most-quoted OU parameter in trading because it answers the practical question: how long does my mean-reversion trade need to be held?
Why OU Fits Mean-Reverting Spreads
Empirically, many financial spreads — pairs trades, Z-scored single-name deviations, basis spreads — behave like OU over short horizons. They have a relatively stable mean (the equilibrium relationship), they don't wander indefinitely, and their deviations decay over time. OU captures all three properties in three parameters.
Stocks themselves are not OU — they have non-stationary drift. But the residuals of a regression between two correlated stocks, or the Z-score of a deviation from a moving average, often look very OU-like. This is why pairs trading and Z-score mean-reversion strategies are the natural OU applications.
Estimation: How QuanterLab Fits OU to Your Data
Given a price (or spread) series, the platform estimates θ, μ, σ via a discrete-time autoregression:
where:
- θ ≈ −ln(1 + b) / Δt — derived from the autoregressive coefficient b.
- μ ≈ −a / b — the implied long-run mean.
- σ — the standard deviation of the residuals ε.
- Half-life ≈ −ln(2) / ln(1 + b) in time units of Δt.
This OLS estimation is fast and robust for clean OU-like series. For noisier series, MLE (maximum likelihood) gives more efficient estimates — both methods are available in SC001STCB.
What the Half-Life Tells You
- Half-life < 5 bars: very fast reversion. Likely noise or microstructure, not a tradable edge.
- Half-life 5–30 bars: tradable mean reversion. Sweet spot for daily-bar strategies.
- Half-life 30–100 bars: slow reversion. Tradable but capital-intensive (longer holds, more drawdown).
- Half-life > 100 bars: very slow. Either the spread is barely mean-reverting or your sample is too short to estimate reliably.
- Half-life negative or extremely large: the series is not actually mean-reverting. Walk away.
Generating Trade Signals from OU
Once you have estimated parameters, the standard signal generation is:
- Compute the current Z-score: Z(t) = (X(t) − μ) / σ_eq, where σ_eq = σ × √(1 / (2θ)) is the equilibrium standard deviation of OU.
- Enter long when Z < −threshold (price below mean by enough).
- Enter short when Z > +threshold.
- Exit when Z crosses zero (or some smaller exit threshold).
The optimal entry and exit thresholds are not arbitrary — they depend on θ, σ, transaction costs, and how risk-averse you are. Bertram (2010) gives the analytic solution for OU strategies; QuanterLab's grid search explores the threshold space empirically.
Where OU Breaks Down
- Regime change. If the underlying relationship breaks (e.g., a structural change in two paired stocks), the estimated μ becomes obsolete and the strategy bleeds.
- Fat tails. Real financial spreads have non-Gaussian noise. OU's Gaussian assumption can underestimate large excursions.
- Time-varying parameters. Real spreads may have time-varying θ and σ. The Kalman filter generalizes OU to handle this — see the Kalman Filter for Mean Reversion article.
- Non-stationarity. If the series is not mean-reverting, OU estimates produce nonsense (negative half-life, drifting μ). Always verify stationarity (ADF, KPSS, Hurst) before trusting OU output.
The Bottom Line
OU is the simplest model that captures everything you need for mean-reversion trading: where the mean is, how fast you revert to it, and how noisy the path is. Master it, and you have the foundation for pairs trading, Z-score strategies, and most of the more elaborate stochastic models. Misuse it (on non-stationary series) and you produce confidently-wrong half-lives and reliably-losing strategies.
Further Reading
Foundational papers
- Vasicek, O. (1977). An Equilibrium Characterization of the Term Structure. Journal of Financial Economics, 5(2), 177–188.
- Avellaneda, M. & Lee, J.-H. (2010). Statistical Arbitrage in the U.S. Equities Market. Quantitative Finance, 10(7), 761–782.
- Bertram, W. K. (2010). Analytic Solutions for Optimal Statistical Arbitrage Trading. Physica A, 389(11), 2234–2243.
Textbook references
- Hamilton, J. D. (1994). Time Series Analysis. Princeton University Press.
- Tsay, R. S. (2010). Analysis of Financial Time Series (3rd ed.). Wiley.
Related QuanterLab articles
- Half-Life: Speed of Mean Reversion
- Z-Score Entry/Exit Bands
- Optimal Trading Bands
- ADF and KPSS Stationarity Tests
Try it in QuanterLab
In SC001STCB select the OU Z-Score method on a liquid spread (e.g., XOM vs CVX residuals). Look at the estimated half-life — if it's > 100 bars or negative, the spread is not OU-like; do not trade.