The Ornstein–Uhlenbeck Process

Some things wander, and some things come home. A stock price modelled by geometric Brownian motion wanders — it can drift off to infinity, or dwindle toward zero, and nothing calls it back. But look around at the quantities that actually run the world of finance and physics: the temperature in July, a short-term interest rate, a market's volatility, the price gap between two nearly identical assets. Each one gets pulled back whenever it strays. A heatwave breaks. A rate spike gets leaned on by the central bank. Volatility explodes in a crisis and then bleeds back down. Two share classes of the same company drift apart and arbitrageurs squeeze them together again.

The Ornstein–Uhlenbeck (OU) process is the mathematics of that rubber band — the mean-reverting counterweight to Brownian drift. It is the simplest SDE whose solution is tethered:

dX_t = \theta(\mu - X_t)\,dt + \sigma\,dW_t.

Three parameters, three jobs. \mu is the long-run level — home. \theta > 0 is the speed of mean reversion — the stiffness of the rubber band. \sigma is the noise that keeps yanking the process away from home, so it never simply settles. The tug-of-war between the pull toward \mu and the ceaseless kicks of dW_t is what gives OU its hallmark: it fluctuates forever, but it does not run away.

Reading the anatomy: the further you stray, the harder the pull

Read the drift \theta(\mu - X_t) as a restoring force, and work the signs on both sides of home. Take a concrete process with \theta = 2 and \mu = 5:

The pull always points toward \mu, and its strength grows linearly with the distance from \mu — stray twice as far and the pull is twice as hard. If that sounds like a spring, it should: this is exactly Hooke's law with noise, F = -k\,x dressed up as a drift. Meanwhile the diffusion term \sigma\,dW_t is completely indifferent to where the process is — the kicks are the same size at X_t = 3, 5, or 8 (contrast GBM, whose noise scales with the level). Constant kicks, position-dependent pull: everything OU does follows from that combination.

Solving OU by the integrating factor

Here is a rare treat: OU is the SDE a student can solve completely, in closed form, with an honest derivation. The drift contains an -\theta X_t term, so the equation is linear in X_t but not constant-coefficient. The classical cure for a linear equation is an integrating factor: multiply by e^{\theta t} to make the left side a perfect differential. The only new subtlety over the deterministic case is keeping track of the stochastic term — but e^{\theta t} is a smooth, deterministic function of time, so it has finite variation and contributes no covariation term.

Step 1 — apply the Itô product rule to e^{\theta t} X_t. The product rule is d(UV) = U\,dV + V\,dU + d[U, V]. Here U = e^{\theta t} is smooth in t with dU = \theta e^{\theta t}\,dt, and V = X_t. Because U has finite variation, the covariation d[U, V] = 0, leaving

d\big(e^{\theta t} X_t\big) = e^{\theta t}\,dX_t + X_t\,\theta e^{\theta t}\,dt.

Step 2 — substitute the OU dynamics dX_t = \theta(\mu - X_t)\,dt + \sigma\,dW_t into the first term:

d\big(e^{\theta t} X_t\big) = e^{\theta t}\big[\theta(\mu - X_t)\,dt + \sigma\,dW_t\big] + \theta e^{\theta t} X_t\,dt.

Step 3 — watch the X_t terms cancel. Expand the bracket: e^{\theta t}\theta\mu\,dt - e^{\theta t}\theta X_t\,dt + e^{\theta t}\sigma\,dW_t, then add the last +\theta e^{\theta t} X_t\,dt. The two \theta e^{\theta t} X_t\,dt terms have opposite signs and annihilate — which is exactly why e^{\theta t} was the right factor:

d\big(e^{\theta t} X_t\big) = \theta\mu\, e^{\theta t}\,dt + \sigma e^{\theta t}\,dW_t.

Step 4 — integrate from 0 to t. The left side telescopes. On the right, the first integral is elementary (\int_0^t \theta\mu\,e^{\theta s}\,ds = \mu(e^{\theta t} - 1)), and the second is an Itô integral we leave as is:

e^{\theta t} X_t - X_0 = \mu\big(e^{\theta t} - 1\big) + \sigma\int_0^t e^{\theta s}\,dW_s.

Step 5 — multiply back by e^{-\theta t} to isolate X_t. Distribute the factor across every term:

X_t = e^{-\theta t} X_0 + \mu\big(1 - e^{-\theta t}\big) + \sigma\int_0^t e^{-\theta(t - s)}\,dW_s.

Step 6 — tidy. Group the two deterministic terms around \mu to expose the reversion cleanly:

X_t = \mu + (X_0 - \mu)\,e^{-\theta t} + \sigma\int_0^t e^{-\theta(t - s)}\,dW_s.

Read it off: the process is the level \mu, plus a deterministic memory of the start (X_0 - \mu)e^{-\theta t} that decays exponentially, plus a weighted average of past noise in which older shocks (small s) are exponentially discounted by e^{-\theta(t - s)}. The process forgets both its start and its old kicks at rate \theta. Compare Brownian motion, where every shock counts in full forever: OU has an exponentially fading memory, and that fading memory is mean reversion seen from the inside.

Gaussian, mean-reverting, and stationary

Everything we want now reads off the solution. The stochastic integral \int_0^t e^{-\theta(t-s)}\,dW_s is an Itô integral of a deterministic function against Brownian motion, which is a Gaussian random variable with mean zero. So X_t is a constant plus a Gaussian — hence Gaussian itself.

The mean. The stochastic integral has mean zero, so taking expectations of the solution kills the last term:

\mathbb{E}[X_t] = \mu + (X_0 - \mu)\,e^{-\theta t} \;\xrightarrow[t\to\infty]{}\; \mu.

The mean glides exponentially from X_0 toward the level \mu — this is mean reversion made precise.

The variance comes from the Itô isometry, which turns the variance of a stochastic integral into an ordinary integral of the squared integrand:

\operatorname{Var}(X_t) = \sigma^2\,\mathbb{E}\!\left[\left(\int_0^t e^{-\theta(t-s)}\,dW_s\right)^{\!2}\right] = \sigma^2 \int_0^t e^{-2\theta(t - s)}\,ds.

Substitute u = t - s (so du = -ds, and the limits flip to 0 to t) and integrate the exponential:

\operatorname{Var}(X_t) = \sigma^2 \int_0^t e^{-2\theta u}\,du = \sigma^2\cdot\frac{1 - e^{-2\theta t}}{2\theta} \;\xrightarrow[t\to\infty]{}\; \frac{\sigma^2}{2\theta}.

As t \to \infty the memory of the start fades and the variance settles to the stationary value \sigma^2/(2\theta): a balance between the noise \sigma^2 pumping spread in and the reversion 2\theta draining it out. Stronger pull or weaker noise gives a tighter stationary band. Putting mean and variance together, the long run of an OU process is a fixed Gaussian law:

X_t \;\xrightarrow[t\to\infty]{d}\; \mathcal{N}\!\left(\mu,\; \frac{\sigma^2}{2\theta}\right).

This is the stationary distribution — start the process there and it stays there (in law) forever, forever jiggling but statistically frozen. Brownian motion and GBM have no such thing: their variance grows without bound. OU is the textbook example of a process that equilibrates.

The SDE dX_t = \theta(\mu - X_t)\,dt + \sigma\,dW_t with \theta > 0 has the unique solution

X_t = \mu + (X_0 - \mu)\,e^{-\theta t} + \sigma\int_0^t e^{-\theta(t - s)}\,dW_s,

with the following properties:

Mean reversion is the economic content. A short-term interest rate cannot drift to infinity or plunge arbitrarily — central banks and markets pull it back toward a long-run level. The Vasicek model (1977) is exactly OU applied to the short rate r_t:

dr_t = \theta(\mu - r_t)\,dt + \sigma\,dW_t,

with \mu the long-run rate, \theta the reversion speed, and \sigma the rate's volatility. Its Gaussian, closed-form law makes bond prices analytically tractable — the payoff of choosing an analytically friendly process. Its one notorious flaw is the flip side of being Gaussian: the rate can go negative (once a deal-breaker, now occasionally realistic).

The stationary variance from the isometry. The long-run spread \sigma^2/(2\theta) is worth re-deriving as a sanity check. In stationarity, take the variance of dX = \theta(\mu - X)\,dt + \sigma\,dW and demand it not change: the noise injects variance at rate \sigma^2 per unit time while reversion removes it at rate 2\theta\operatorname{Var}(X) (the factor two from squaring). Setting injection equal to removal, \sigma^2 = 2\theta\operatorname{Var}(X), gives \operatorname{Var}(X) = \sigma^2/(2\theta) — the same value the Itô isometry produced above, now seen as a steady-state balance.

The half-life of mean reversion

"Speed of reversion \theta" is abstract; traders translate it into a number with teeth: how long until half the gap to \mu is expected to close? From the mean formula, the expected gap is \mathbb{E}[X_t] - \mu = (X_0 - \mu)e^{-\theta t}. Set the decay factor to one half and solve:

e^{-\theta t_{1/2}} = \tfrac12 \;\Longleftrightarrow\; \theta\, t_{1/2} = \ln 2 \;\Longleftrightarrow\; t_{1/2} = \frac{\ln 2}{\theta} \approx \frac{0.693}{\theta}.

Note the units: \theta is a rate, per unit time, so the half-life comes out in whatever time unit \theta was quoted in. Work a few concrete speeds (with \theta per year, and ~252 trading days a year):

Two remarks. First, the half-life depends on \theta only — not on \sigma, not on how far away you start. Halving the gap from 10 takes exactly as long as halving it from 2. Second, this is a statement about the mean: any individual path is being kicked the whole time and will cross, overshoot, and recross \mu in its own jagged way. The half-life tells you when the expected gap has halved — which is exactly the number you need to estimate how long your capital will be tied up in a convergence trade.

Three traps, in ascending order of expensiveness:

Pairs trading: OU as a trading signal

Here is the quant-desk application that made OU famous outside physics. Take two assets that are near-substitutes — two share classes of one company, two oil majors, an ETF and its basket — and form the spread S_t = A_t - \beta B_t (with \beta the hedge ratio from a regression). Neither asset alone reverts to anything, but economics glues them together: if the spread widens, arbitrageurs buy the cheap leg and sell the rich one, pulling it back. That's a restoring force proportional to displacement — so model the spread as OU.

The rule. Fit \theta, \mu, \sigma to the spread's history (a linear AR(1) regression of \Delta S on S does it — OU sampled at fixed intervals is an AR(1)). Standardise the current spread by its stationary standard deviation to get a z-score:

z_t = \frac{S_t - \mu}{\sigma/\sqrt{2\theta}}.

Enter when the spread is stretched — say |z_t| \ge k with k = 2 — shorting the spread when z is high, buying it when low; exit as z returns near zero.

Worked numbers. Suppose the fit gives \mu = 0, \sigma = 0.4, \theta = 8 per year. The stationary standard deviation is \sigma/\sqrt{2\theta} = 0.4/\sqrt{16} = 0.10, so a k = 2 rule fires when the spread reaches \pm 0.20. The half-life is \ln 2/8 \approx 0.087 years — about 22 trading days — so on average half the mispricing heals in a month: a tradable horizon. If instead the fit gave \theta = 0.5, the half-life would be 1.4 years; the same 2-standard-deviation entry would be statistically identical but economically useless, with capital (and borrowing costs) tied up for seasons. The z-score tells you whether the spread is stretched; \theta tells you whether it's worth waiting for the snap-back.

Because Einstein's Brownian motion had a bug. Einstein (1905) modelled the position of a pollen grain as a random walk, and it worked beautifully — but push the model one derivative further and it breaks. A Brownian path is nowhere differentiable, so the model literally says the particle's velocity doesn't exist; and if you tried to make velocity itself a random walk, it would grow without bound, which no fluid tolerates. Real particles feel friction: the faster you move through water, the harder the drag pulls your speed back toward zero. In 1930 Leonard Ornstein and George Uhlenbeck wrote that down: velocity obeys m\,dv_t = -\gamma v_t\,dt + \sigma\,dW_t — precisely our OU process with \mu = 0 and \theta = \gamma/m. Friction is the rubber band; molecular bombardment is the noise; the stationary distribution \mathcal{N}(0, \sigma^2/2\theta) is nothing other than Maxwell's distribution of thermal speeds. Physics got a consistent theory of Brownian velocity; probability got its canonical mean-reverting process.

Forty-seven years later Vasicek borrowed the same equation for interest rates, and by the 1990s mean reversion was a business model: Long-Term Capital Management, staffed with Nobel laureates, bet enormous leverage on stretched spreads snapping back to \mu. The spreads were genuinely mean-reverting — but in the 1998 Russian default they stretched further, and further still, and LTCM's capital ran out before the reversion arrived. The rubber band always pulls; it never promises when. Every item in the "Watch out!" list above was paid for, at scale, that autumn.

Watch it revert

Below are several OU paths, each started away from the level \mu (the dashed line) and pulled back toward it at speed \theta, while the noise \sigma jostles them. The dotted lines mark the stationary band \mu \pm \sigma/\sqrt{2\theta} — one standard deviation of the long-run Gaussian, so once the paths have settled they should spend roughly two-thirds of their time inside it. Each run prints the \theta, \mu, \sigma it drew; Refresh for a fresh batch.

Three things to check against the theory as you watch. The approach: every path's early drift toward \mu is roughly exponential, and after one half-life \ln 2/\theta about half the initial gap is gone — eyeball it on a run with a small \theta, where the glide is slow enough to see. The crossings: paths do not arrive at \mu and stop; they slice through it and overshoot, again and again — count the crossings on any path and you'll lose count. That's the "Watch out!" made visible. The band: a run with large \theta and small \sigma hugs a tight band; weak pull with loud noise wanders in a wide one — the \sigma^2/2\theta balance, live.