The Ornstein-Uhlenbeck Process
The standard model for something on a leash. It wanders randomly like a price, but the further it strays from a home level the harder it is pulled back, which gives it a typical range and a measurable half-life instead of drifting away forever.
Prerequisites: Mean Reversion, Brownian Motion
Some quantities have no home. A share price that doubles has no particular reason to come back — its new level is just as reasonable as the old one. Other quantities plainly do have a home. The price gap between two nearly identical oil futures, the spread between a stock and its sector, the yield on a three-month bill: each of these wanders, but when it wanders far enough something economic pushes it back. Modelling the second kind with the tools built for the first kind is one of the most expensive mistakes in systematic trading, because it throws away the only edge in the data.
The rubber band
Picture a bead on a table, attached to a fixed peg by a rubber band, in a room full of random draughts. The draughts shove the bead in whatever direction they like — that part is pure random walk. The band does something different: it pulls, and the pull gets stronger the further the bead is from the peg. Nudge the bead an inch away and the tension is gentle. Drag it a foot away and it snaps back hard.
That is the whole process. Random shoves, plus a restoring pull proportional to how far you have strayed. The bead never settles on the peg — the draughts see to that — but it spends most of its life within a band around it, and if you find it unusually far out you can bet, with the odds on your side, that it will be closer soon.
The one equation you need
Three symbols. is the home level, the peg — the value the process is pulled toward. (theta) is the pull strength, how forcefully the band works. is the size of the random shoves, and is the shove itself.
In plain English: over the next moment, the process moves a bit toward home — an amount proportional to how far away it currently is — and gets a random kick on top. When sits above , the bracket is negative and the pull is downward. When sits below, the bracket flips positive and the pull is upward. That sign flip, and nothing else, is what makes the process mean-reverting.
Set and the pull disappears; you are left with plain Brownian motion, free to wander anywhere. Everything interesting about this process is contained in how big is relative to how long you are willing to hold.
Half-life: the number you actually trade on
is awkward to reason about because its units are "per unit time". Convert it into a duration instead:
In plain English: the half-life is how long it takes, on average, for half of the current distance from home to be closed. If the spread is 2.0 away from fair and the half-life is ten days, then in ten days you expect it to be about 1.0 away, in twenty days about 0.5, and so on. It is the same arithmetic as radioactive decay, and it is the single most useful number you can extract from a candidate spread.
Worked example: sizing up a pairs spread
You have the dollar spread between two related stocks and you want to know whether it is worth trading. Regress today's spread on yesterday's — an AR(1) fit, the discrete-time cousin of the process above — and suppose you get a slope of with residuals of standard deviation per day.
Step 1 — pull strength. A daily slope corresponds to per day.
Step 2 — half-life. days. So a spread sitting at an extreme should give back half its dislocation in under three trading weeks. That is a tradeable horizon: slow enough that transaction costs are a rounding error, fast enough that capital is not tied up for a quarter.
Step 3 — the typical range. For an AR(1), the long-run standard deviation is the residual size divided by :
So the spread's natural swing is about 1.28 in either direction. A two-sigma entry band is therefore roughly , not some round number you picked by eye. Notice how the pull converts noise into a bounded range: the daily shock is only 0.40 but the accumulated wandering settles at 1.28, because the band keeps hauling it in. Without the pull, that same 0.40 daily noise would grow without limit — after a year it would be wide.
Step 4 — the trade. Enter at , expect to be near in 13.5 days, and set a stop wide enough that a spread at three sigma does not knock you out, because three sigma happens.
Run the explorer below and switch it to reverting. Drag the volatility up: the paths get noisier but the fan stops widening — it hits a ceiling and stays there, which is exactly the boundedness that made step 3 possible. Compare with brownian, where the fan never stops spreading.
An Ornstein–Uhlenbeck process is a random walk with a leash. Its two useful outputs are the half-life , which tells you how long a trade should take, and the long-run spread, which tells you what counts as far from home. If you cannot state both numbers for a signal, you are not trading mean reversion — you are guessing.
What this means in practice
- Pairs and stat arb. The whole pairs trading pipeline is: build a spread, test that it is genuinely tied together with a cointegration test, fit the half-life, and size the entry band off the long-run standard deviation.
- Interest rates. The Vasicek model is this process applied to the short rate, and it is the reason rate models produce a term structure that flattens out at long maturities rather than fanning out like an equity model.
- Market-making inventory. A desk that quotes both sides and gets randomly filled accumulates inventory that behaves like this: random arrivals push it around, skewing quotes pulls it back toward flat.
- Sanity-checking a signal. Half-lives cluster in a useful way. Under a day and costs will eat it. Between a few days and a couple of months is the tradeable zone. Over a year and you cannot distinguish it from a slow drift with the data you have.
Fitting this process to any series will always return a , and that will almost always look positive. Regression toward the mean is a statistical artefact that appears in random walks too, especially in short samples, and a half-life estimated in-sample is biased toward looking fast. Before believing it, check that the spread is economically anchored — a real hedge relationship, a real arbitrage — and re-fit on data you did not use to pick the pair. A spread that reverts beautifully in backtest and not at all live has usually failed this exact test.
The half-life doubles as a lookback rule. If your fitted half-life is 13 days, computing the spread's mean and standard deviation over a 250-day window is far too slow to track it and a 3-day window is pure noise. A window of roughly three to five half-lives — say 40 to 65 days here — is the usual sweet spot.
Related concepts
Practice in interviews
Further reading
- Uhlenbeck & Ornstein (1930), On the Theory of the Brownian Motion
- Vasicek (1977), An Equilibrium Characterization of the Term Structure
- Chan, Algorithmic Trading (ch. 2-3)