The Ornstein-Uhlenbeck Process: Mean Reversion Done Right
The OU process, its SDE, calibration to mean-reverting series, and why half-life is the most useful parameter for traders.
Geometric Brownian motion is great for stocks, but lots of things in finance are not geometric. Spreads between correlated assets revert to a mean. Interest rates mean-revert. Volatility clusters around a long-run level. Inventory positions get dragged back toward target. The right tool for all of these is the Ornstein-Uhlenbeck process.
The OU process is the continuous-time limit of an AR(1) process. It is the simplest mean-reverting diffusion. It has a stationary distribution, a Gaussian transition law, and a closed-form solution. It is also the basis of the Vasicek interest-rate model, which we cover in the next article.
This article walks through the SDE, solves it explicitly, derives the half-life formula, and shows how to calibrate it to data. If you have ever run a pairs trade, you have implicitly used OU.
The SDE
The Ornstein-Uhlenbeck process satisfies
Three parameters: is the speed of mean reversion, is the long-run mean, is the volatility. The drift pulls toward at rate — fast when is far from , slow when it is close. The diffusion is constant, not proportional to (that would be a different beast).
Compare to GBM: . The drift in GBM is proportional to , so the process is non-stationary (it grows without bound). The drift in OU has a sign-reversing term , which creates a restoring force and produces stationarity. The diffusion in OU is constant, so does not blow up. The combination of restoring drift and constant diffusion is what makes OU so useful.
If , the equation reduces to , which is Brownian motion (non-stationary). If is large, mean reversion is strong and stays close to . The dimensionless quantity relative to controls the behavior.
The Explicit Solution
The OU process is one of the few non-trivial SDEs with a closed-form solution. Apply Itô’s lemma to :
Integrating from 0 to :
Solving for :
This is the explicit OU path. Three pieces: the long-run mean , the initial-condition decay , and a stochastic convolution against the Brownian motion. The convolution is a Gaussian random variable with mean zero and variance .
Therefore, conditional on , the distribution of is Gaussian:
The mean reverts to at rate . The variance converges to , the stationary variance.
The Stationary Distribution
As , the influence of vanishes (the term goes to zero). The distribution of converges to
This is the stationary distribution of the OU process. It is Gaussian with mean and variance . The process does not blow up; it does not drift away; it lives forever around , with fluctuations proportional to .
Two important consequences:
- The unconditional mean is . The unconditional variance is .
- Higher (faster reversion) or lower (less noise) means smaller stationary variance. The process hugs the mean more tightly.
The stationary distribution is what you should think of when you hear “mean reverting to with vol ”. It is the equilibrium of the process.
The Half-Life
The most useful summary statistic for an OU process is the half-life of mean reversion. From the explicit solution, the deviation from the mean is . The half-life is the time it takes for this to drop by half:
So if (per year), the half-life is about 1.4 years. If (per year), it is about 0.35 years. The faster the reversion, the shorter the half-life.
The half-life is what traders quote when they say “this pair reverts over 30 days” or “rates have a 5-year half-life”. It is more interpretable than because it directly maps to time. It also gives you a rule of thumb: if you see a deviation that has persisted for several half-lives, the “mean reversion trade” has probably failed.
A common pitfall: an OU process with very small (long half-life) looks like a random walk over short horizons. Over 30 days, an OU with half-life 250 days has barely moved toward the mean. If your lookback is short and your half-life is long, you cannot tell whether you are seeing mean reversion or just noise.
The Fokker-Planck Equation
The OU process has a transition density given by the Gaussian above. The evolution of the density over time is governed by the Fokker-Planck equation:
The first term is the drift contribution (probability flows toward ). The second is the diffusion contribution (probability spreads out). At stationarity, , and the Gaussian above is the solution.
For Monte Carlo, you do not need the Fokker-Planck equation directly. But it is useful for understanding how the distribution evolves and for verifying simulation results. For non-OU processes (jump-diffusions, Lévy), the Fokker-Planck equation generalizes to a partial-integro-differential equation.
Calibration to Data
Suppose you observe a time series at equally spaced times . You want to estimate , , .
The discrete-time analog of OU is the AR(1) process:
The relationship to continuous-time parameters is:
So you can estimate , , by OLS regression, then back out , , :
This is the standard calibration. It is fast (one OLS) and gives maximum-likelihood estimates under Gaussian noise.
A few practical notes:
- Use the autocorrelation of the series to spot-check . The lag-1 autocorrelation of an OU-discretized series is . If you see lag-1 autocorrelation close to 1, is small.
- For slow reversion (), the OLS estimate of is close to 1, and small biases in get amplified by the transformation. Be careful.
- For fast reversion (), the discrete series is nearly independent. The half-life is shorter than the sampling interval, and you cannot reliably estimate . You need higher-frequency data.
import numpy as np
from scipy import stats
def calibrate_ou(x, dt):
"""Calibrate OU parameters from a time series."""
x_lag = x[:-1]
x_now = x[1:]
slope, intercept, r_value, _, _ = stats.linregress(x_lag, x_now)
b = slope
a = intercept
resid = x_now - (a + b * x_lag)
s2 = resid.var(ddof=2)
kappa = -np.log(b) / dt
theta = a / (1 - b)
sigma = np.sqrt(s2 * 2 * kappa / (1 - b**2))
half_life = np.log(2) / kappa
return kappa, theta, sigma, half_life
This is the canonical estimator. Run it on a simulated series to verify it recovers known parameters. Run it on real data to get calibrated , , , and the half-life.
Pairs Trading
The canonical quant use of OU is pairs trading. Find two cointegrated assets and . Compute the spread where is the cointegration coefficient. Model as OU. When deviates from , bet on reversion: long , short units of .
The OU parameters determine the trade. The half-life tells you the expected holding period. The stationary variance tells you the typical size of mean-reversion moves. The current deviation from , measured in units of stationary standard deviation, is the z-score. Trade only when the z-score is extreme (say, ).
A backtest of pairs trading requires simulating OU paths with calibrated parameters. The OU assumption is critical: without mean reversion, the strategy has no expected return, only drawdowns.
The Vasicek Connection
The OU process is the building block of the Vasicek short-rate model:
The short rate follows OU. It can go negative (which is empirically wrong for most currencies, but mathematically clean). The bond pricing formula under Vasicek is closed-form and uses the OU transition density. We cover this in the next article.
OU also underlies the Bergomi model for forward variance, the Schöbel-Zhu model for stochastic vol, and many practitioner models for commodity spreads. The same SDE, dressed up with different state variables, fits different markets.
The Half-Life in Practice
The half-life of mean reversion is the single most useful number for a quant who trades mean-reverting strategies. Three rules of thumb:
- Long half-life (years). Slow reversion. Position sizes should be small, since each move is small relative to the deviation. Holding periods are long. Funding costs matter.
- Medium half-life (weeks to months). The sweet spot for many pairs trades. Moves are meaningful, holding periods are tractable, funding costs are tolerable.
- Short half-life (days). Fast reversion. Position sizes can be large. Funding costs are low. But the model is more sensitive to microstructure (bid-ask bounce, discrete prices).
If you calibrate a half-life of 30 days, your strategy should hold for about that long on average. If you hold for 5 days, you are exiting before the reversion. If you hold for 200 days, you are well past the typical mean-reversion time and exposed to model misspecification.
Failure Modes
OU is a linear, Gaussian model. It fails when:
- The process is nonlinear. Drift depends on in a non-affine way. Solution: use a different SDE (CIR, CEV, jump-diffusion).
- The process has jumps. Discrete shocks that violate continuity. Solution: jump-diffusion.
- Regime switches. The parameters themselves change over time. Solution: hidden Markov models or piecewise-OU.
- The series is non-stationary. The mean or variance drifts. Solution: difference the series or use a different model.
In practice, many “OU” series in finance are not really OU. They look like OU over short windows but the parameters drift over longer windows. Calibrate with care, and re-estimate frequently.
What to Take Away
The Ornstein-Uhlenbeck process is the simplest mean-reverting diffusion. Its SDE is , with closed-form transition density and stationary distribution. The half-life is the most useful summary statistic.
Use OU for spreads, rates, and any series that hovers around a long-run level. Calibrate by OLS on the AR(1) discretization. Trade when deviations are large in units of stationary standard deviation, and exit at roughly the half-life. The model is simple, robust, and widely applicable.
References: Øksendal (2003), Section 5.2; Glasserman (2004), Section 3.4 (the Cox-Ingersoll-Ross extension); Hull (2018), Ch. 31 (mean reversion in rates); Luenberger (1998), Chapter 11. ISBN: 978-0-19-510809-5. The original OU process was proposed in 1930 by Leonard Ornstein and George Uhlenbeck as a model of Brownian motion with friction. It is one of the oldest continuous-time stochastic processes, and still one of the most useful.
The Vasicek Bridge
The OU process is what makes the Vasicek short-rate model tractable. If is OU, then for any horizon , the conditional distribution of given is Gaussian with explicit mean and variance:
This is the only Gaussian short-rate model with closed-form bond prices. The bond price is the discount factor , and the integral of an OU process is normally distributed (a linear functional of a Gaussian process is Gaussian). So we can compute the expectation in closed form. The Vasicek bond price formula is
where
and involves the integral of the mean-reverting drift. The key fact: bond prices are affine in . That is the defining property of affine term structure models.
The next article covers Vasicek and its extension, the Cox-Ingersoll-Ross model, in detail.
Cointegration and the Engle-Granger Two-Step
In pairs trading, we typically assume that the two assets and are cointegrated: there exists a linear combination such that is stationary. The Engle-Granger procedure:
- Regress on (with intercept): . Get residuals .
- Test the residuals for stationarity using the Augmented Dickey-Fuller test.
- If stationary, model as OU and proceed.
The coefficient from step 1 is the cointegration vector. The half-life from the OU calibration tells you the speed of reversion. The current value of is the deviation from equilibrium; its z-score (relative to stationary standard deviation) is the trading signal.
A common pitfall: the regression is fit to historical data. If the relationship between and is unstable, drifts, and your spread is misspecified. Re-estimate frequently (rolling windows), or use a more sophisticated method like Johansen’s procedure for multiple cointegrated assets.
The half-life estimate is sensitive to the lookback window. A long window gives a stable estimate but may include periods when the relationship was different. A short window is responsive but noisy. There is no perfect answer. Most pairs traders use windows between 60 and 250 trading days.
A Note on the Speed of Mean Reversion
The parameter has units of inverse time. If you fit OU to daily data and get , the half-life is about 139 days. But if you fit to weekly data, you get a different number because the OLS estimator depends on the sampling interval. Specifically, the lag-1 autocorrelation at sampling interval is , so the estimator recovers via . Different implies different , hence different .
This is not a bug. It reflects the fact that continuous-time parameters are scale-invariant, while discrete estimates depend on the sampling frequency. The right answer is: calibrate in whatever units are natural for your problem, then convert half-life to the same units.
In practice, most quots express per year, with half-life in years. So corresponds to a half-life of years.
Why Not Use a Higher-Order AR Model?
OU is an AR(1) in continuous time. You could imagine fitting an AR(2) or AR(p) to a mean-reverting series. The advantage is more flexibility; the disadvantage is no closed-form SDE. For trading purposes, the simplicity of OU is hard to beat. Most mean-reverting strategies can be expressed in terms of OU parameters.
If the series has complex autocorrelation structure (oscillations, multiple time scales), AR(2) or regime-switching models may be warranted. But you should always start with OU and only complicate the model if there is clear evidence of misspecification. The principle of parsimony applies.
The Ornstein-Uhlenbeck Bridge: A Beautiful Identity
The OU process has a clean connection to Brownian motion. Specifically, the OU bridge — the OU process conditioned on a fixed terminal value — has explicit transition law. It is a Brownian bridge (which is itself a Gaussian process with linear mean and quadratic variance) plus a correction for the mean-reverting drift.
This is useful for Monte Carlo simulation when you need to condition on a terminal event. Instead of simulating many full paths and rejecting those that do not end at , you can directly simulate the bridge. It is faster and lower-variance.
The formula: conditional on and , the OU bridge at time is
where and are explicit functions of , , , , . The expressions are derived using the Gaussian transition law twice and the Markov property.
For pricing path-dependent options with terminal conditioning (e.g., a forward-start option whose payoff depends on the price at a future time), the bridge representation lets you simulate only the relevant increments.
An Aside: OU and Einstein
The OU process has a physical interpretation. Brownian motion with friction. Einstein’s 1905 paper on Brownian motion gave the diffusion equation. Ornstein and Uhlenbeck added a friction term to the velocity, which produces a stationary velocity distribution (the Maxwell-Boltzmann). The same SDE shows up in physics for any damped harmonic oscillator driven by noise.
In finance, the friction is mean reversion. A series that fluctuates around a long-run mean is like a particle in a potential well with friction. The stationary distribution is the Boltzmann distribution of the well.
This physical analogy is occasionally useful for intuition, but it is mostly aesthetic. The math is the same either way.
Final Word: A Trading Recipe
If you are using OU to trade a mean-reverting series:
- Calibrate , , on a rolling window of recent data.
- Compute the half-life .
- Compute the current z-score .
- Enter a position when (e.g., 2).
- Exit when crosses zero (mean reversion achieved) or after (time stop).
- Size positions inversely proportional to (longer half-life means smaller size, because each move is slow).
This is the canonical recipe. It is not the only way to trade OU, but it is the most common. Backtest on simulated paths to estimate expected P&L, then trade on real data with risk limits. Half of the edge comes from the model. The other half comes from disciplined execution. The model is what we have covered here. The execution is on you.