Skip to content

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.

10 of 12 ~16 min

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 XtX_t satisfies

dXt=κ(θ−Xt) dt+σ dWtdX_t = \kappa(\theta - X_t) \, dt + \sigma \, dW_t

Three parameters: κ>0\kappa > 0 is the speed of mean reversion, θ\theta is the long-run mean, σ>0\sigma > 0 is the volatility. The drift κ(θ−Xt)\kappa(\theta - X_t) pulls XtX_t toward θ\theta at rate κ\kappa — fast when XtX_t is far from θ\theta, slow when it is close. The diffusion σ\sigma is constant, not proportional to XtX_t (that would be a different beast).

Compare to GBM: dSt=μSt dt+σSt dWtdS_t = \mu S_t \, dt + \sigma S_t \, dW_t. The drift in GBM is proportional to StS_t, so the process is non-stationary (it grows without bound). The drift in OU has a sign-reversing term θ−Xt\theta - X_t, which creates a restoring force and produces stationarity. The diffusion in OU is constant, so XtX_t does not blow up. The combination of restoring drift and constant diffusion is what makes OU so useful.

If κ=0\kappa = 0, the equation reduces to dXt=σ dWtdX_t = \sigma \, dW_t, which is Brownian motion (non-stationary). If κ\kappa is large, mean reversion is strong and XtX_t stays close to θ\theta. The dimensionless quantity κ\kappa relative to σ2\sigma^2 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 eκtXte^{\kappa t} X_t:

d(eκtXt)=κeκtXt dt+eκt dXt=κeκtXt dt+eκt[κ(θ−Xt) dt+σ dWt]d(e^{\kappa t} X_t) = \kappa e^{\kappa t} X_t \, dt + e^{\kappa t} \, dX_t = \kappa e^{\kappa t} X_t \, dt + e^{\kappa t} [\kappa(\theta - X_t) \, dt + \sigma \, dW_t] =κθeκt dt+σeκt dWt= \kappa \theta e^{\kappa t} \, dt + \sigma e^{\kappa t} \, dW_t

Integrating from 0 to tt:

eκtXt−X0=κθ∫0teκs ds+σ∫0teκs dWs=θ(eκt−1)+σ∫0teκs dWse^{\kappa t} X_t - X_0 = \kappa \theta \int_0^t e^{\kappa s} \, ds + \sigma \int_0^t e^{\kappa s} \, dW_s = \theta(e^{\kappa t} - 1) + \sigma \int_0^t e^{\kappa s} \, dW_s

Solving for XtX_t:

Xt=θ+(X0−θ)e−κt+σ∫0te−κ(t−s) dWsX_t = \theta + (X_0 - \theta) e^{-\kappa t} + \sigma \int_0^t e^{-\kappa(t-s)} \, dW_s

This is the explicit OU path. Three pieces: the long-run mean θ\theta, the initial-condition decay (X0−θ)e−κt(X_0 - \theta) e^{-\kappa t}, and a stochastic convolution against the Brownian motion. The convolution is a Gaussian random variable with mean zero and variance σ2(1−e−2κt)/(2κ)\sigma^2 (1 - e^{-2\kappa t}) / (2\kappa).

Therefore, conditional on X0X_0, the distribution of XtX_t is Gaussian:

Xt∣X0∼N(θ+(X0−θ)e−κt,  σ22κ(1−e−2κt))X_t | X_0 \sim \mathcal{N}\left(\theta + (X_0 - \theta) e^{-\kappa t}, \; \frac{\sigma^2}{2\kappa} (1 - e^{-2\kappa t})\right)

The mean reverts to θ\theta at rate κ\kappa. The variance converges to σ2/(2κ)\sigma^2 / (2\kappa), the stationary variance.

The Stationary Distribution

As t→∞t \to \infty, the influence of X0X_0 vanishes (the e−κte^{-\kappa t} term goes to zero). The distribution of XtX_t converges to

X∞∼N(θ,  σ22κ)X_\infty \sim \mathcal{N}\left(\theta, \; \frac{\sigma^2}{2\kappa}\right)

This is the stationary distribution of the OU process. It is Gaussian with mean θ\theta and variance σ2/(2κ)\sigma^2 / (2\kappa). The process does not blow up; it does not drift away; it lives forever around θ\theta, with fluctuations proportional to σ/2κ\sigma / \sqrt{2\kappa}.

Two important consequences:

  • The unconditional mean is θ\theta. The unconditional variance is σ2/(2κ)\sigma^2 / (2\kappa).
  • Higher κ\kappa (faster reversion) or lower σ\sigma (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 θ\theta with vol σ\sigma”. 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 ∣X0−θ∣e−κt|X_0 - \theta| e^{-\kappa t}. The half-life is the time it takes for this to drop by half:

12=e−κt1/2⇒t1/2=log⁡2κ≈0.693κ\frac{1}{2} = e^{-\kappa t_{1/2}} \quad \Rightarrow \quad t_{1/2} = \frac{\log 2}{\kappa} \approx \frac{0.693}{\kappa}

So if κ=0.5\kappa = 0.5 (per year), the half-life is about 1.4 years. If κ=2\kappa = 2 (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 κ\kappa 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 κ\kappa (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 p(x,t)p(x, t) over time is governed by the Fokker-Planck equation:

∂p∂t=∂∂x[κ(x−θ)p]+σ22∂2p∂x2\frac{\partial p}{\partial t} = \frac{\partial}{\partial x}[\kappa(x - \theta) p] + \frac{\sigma^2}{2} \frac{\partial^2 p}{\partial x^2}

The first term is the drift contribution (probability flows toward θ\theta). The second is the diffusion contribution (probability spreads out). At stationarity, ∂p/∂t=0\partial p / \partial t = 0, 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 X0,X1,…,XnX_0, X_1, \ldots, X_n at equally spaced times Δt\Delta t. You want to estimate κ\kappa, θ\theta, σ\sigma.

The discrete-time analog of OU is the AR(1) process:

Xt+1=a+bXt+ϵt,ϵt∼N(0,s2)X_{t+1} = a + b X_t + \epsilon_t, \quad \epsilon_t \sim \mathcal{N}(0, s^2)

The relationship to continuous-time parameters is:

a=θ(1−e−κΔt),b=e−κΔt,s2=σ22κ(1−e−2κΔt)a = \theta(1 - e^{-\kappa \Delta t}), \quad b = e^{-\kappa \Delta t}, \quad s^2 = \frac{\sigma^2}{2\kappa}(1 - e^{-2\kappa \Delta t})

So you can estimate aa, bb, s2s^2 by OLS regression, then back out κ\kappa, θ\theta, σ\sigma:

κ^=−log⁡b^Δt,θ^=a^1−b^,σ^=s2κ^1−b^2\hat{\kappa} = -\frac{\log \hat{b}}{\Delta t}, \quad \hat{\theta} = \frac{\hat{a}}{1 - \hat{b}}, \quad \hat{\sigma} = s \sqrt{\frac{2\hat{\kappa}}{1 - \hat{b}^2}}

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 κ\kappa. The lag-1 autocorrelation of an OU-discretized series is b^=e−κΔt\hat{b} = e^{-\kappa \Delta t}. If you see lag-1 autocorrelation close to 1, κ\kappa is small.
  • For slow reversion (κΔt≪1\kappa \Delta t \ll 1), the OLS estimate of bb is close to 1, and small biases in b^\hat{b} get amplified by the −log⁡/Δt-\log / \Delta t transformation. Be careful.
  • For fast reversion (κΔt≫1\kappa \Delta t \gg 1), the discrete series is nearly independent. The half-life is shorter than the sampling interval, and you cannot reliably estimate κ\kappa. 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 κ\kappa, θ\theta, σ\sigma, and the half-life.

Pairs Trading

The canonical quant use of OU is pairs trading. Find two cointegrated assets XX and YY. Compute the spread St=Xt−βYtS_t = X_t - \beta Y_t where β\beta is the cointegration coefficient. Model StS_t as OU. When StS_t deviates from θ\theta, bet on reversion: long XX, short β\beta units of YY.

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 θ\theta, measured in units of stationary standard deviation, is the z-score. Trade only when the z-score is extreme (say, ±2\pm 2).

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:

drt=κ(θ−rt) dt+σ dWtdr_t = \kappa(\theta - r_t) \, dt + \sigma \, dW_t

The short rate rtr_t 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:

  1. 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.
  2. Medium half-life (weeks to months). The sweet spot for many pairs trades. Moves are meaningful, holding periods are tractable, funding costs are tolerable.
  3. 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 XX 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 dXt=κ(θ−Xt) dt+σ dWtdX_t = \kappa(\theta - X_t) \, dt + \sigma \, dW_t, with closed-form transition density and stationary distribution. The half-life log⁡2/κ\log 2 / \kappa 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 rtr_t is OU, then for any horizon T>tT > t, the conditional distribution of rTr_T given rtr_t is Gaussian with explicit mean and variance:

rT∣rt∼N(θ+(rt−θ)e−κ(T−t),  σ22κ(1−e−2κ(T−t)))r_T | r_t \sim \mathcal{N}\left(\theta + (r_t - \theta) e^{-\kappa(T-t)}, \; \frac{\sigma^2}{2\kappa}\left(1 - e^{-2\kappa(T-t)}\right)\right)

This is the only Gaussian short-rate model with closed-form bond prices. The bond price P(t,T)P(t, T) is the discount factor EQ[exp⁡(−∫tTru du)∣rt]\mathbb{E}^{\mathbb{Q}}[\exp(-\int_t^T r_u \, du) | r_t], 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

P(t,T)=A(t,T)exp⁡(−B(t,T)rt)P(t, T) = A(t, T) \exp\left(-B(t, T) r_t\right)

where

B(t,T)=1κ(1−e−κ(T−t))B(t, T) = \frac{1}{\kappa}\left(1 - e^{-\kappa(T-t)}\right)

and A(t,T)A(t, T) involves the integral of the mean-reverting drift. The key fact: bond prices are affine in rtr_t. 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 XX and YY are cointegrated: there exists a linear combination β\beta such that St=Xt−βYtS_t = X_t - \beta Y_t is stationary. The Engle-Granger procedure:

  1. Regress XtX_t on YtY_t (with intercept): Xt=α+βYt+ϵtX_t = \alpha + \beta Y_t + \epsilon_t. Get residuals ϵ^t\hat{\epsilon}_t.
  2. Test the residuals for stationarity using the Augmented Dickey-Fuller test.
  3. If stationary, model ϵ^t\hat{\epsilon}_t as OU and proceed.

The coefficient β^\hat{\beta} from step 1 is the cointegration vector. The half-life from the OU calibration tells you the speed of reversion. The current value of ϵ^t\hat{\epsilon}_t is the deviation from equilibrium; its z-score (relative to stationary standard deviation) is the trading signal.

A common pitfall: the regression β\beta is fit to historical data. If the relationship between XX and YY is unstable, β\beta drifts, and your spread is misspecified. Re-estimate β\beta 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 κ\kappa has units of inverse time. If you fit OU to daily data and get κ^=0.005\hat{\kappa} = 0.005, 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 Δt\Delta t is e−κΔte^{-\kappa \Delta t}, so the estimator recovers κ\kappa via −log⁡(b^)/Δt-\log(\hat{b})/\Delta t. Different Δt\Delta t implies different b^\hat{b}, hence different κ^\hat{\kappa}.

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 κ\kappa in whatever units are natural for your problem, then convert half-life to the same units.

In practice, most quots express κ\kappa per year, with half-life in years. So κ^=0.5\hat{\kappa} = 0.5 corresponds to a half-life of 0.693/0.5=1.390.693/0.5 = 1.39 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 XT=xTX_T = x_T — 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 xTx_T, you can directly simulate the bridge. It is faster and lower-variance.

The formula: conditional on X0=x0X_0 = x_0 and XT=xTX_T = x_T, the OU bridge at time s∈(0,T)s \in (0, T) is

Xs∣X0,XT∼N(μs,σs2)X_s | X_0, X_T \sim \mathcal{N}(\mu_s, \sigma_s^2)

where μs\mu_s and σs2\sigma_s^2 are explicit functions of x0x_0, xTx_T, κ\kappa, θ\theta, σ\sigma. 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 −κv-\kappa v 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:

  1. Calibrate κ\kappa, θ\theta, σ\sigma on a rolling window of recent data.
  2. Compute the half-life t1/2=log⁡2/κt_{1/2} = \log 2 / \kappa.
  3. Compute the current z-score z=(Xt−θ)/σ2/(2κ)z = (X_t - \theta) / \sqrt{\sigma^2 / (2\kappa)}.
  4. Enter a position when ∣z∣>zthreshold|z| > z_{\text{threshold}} (e.g., 2).
  5. Exit when zz crosses zero (mean reversion achieved) or after k⋅t1/2k \cdot t_{1/2} (time stop).
  6. Size positions inversely proportional to t1/2t_{1/2} (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.