The Ornstein–Uhlenbeck Process

Geometric Brownian motion wanders off to infinity (or zero); many real quantities do not. An interest rate, a volatility, the spread between two related assets — these revert to a level. The Ornstein–Uhlenbeck (OU) process is the simplest SDE with that behaviour:

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

Read the drift \theta(\mu - X_t) as a restoring force: when X_t is above the level \mu the bracket is negative and the drift pulls it down; when below, the bracket is positive and the drift pushes it up. The speed of reversion \theta > 0 sets how hard the pull is, while the constant diffusion \sigma keeps kicking it off course. The tug-of-war between the pull toward \mu and the noise is what gives OU its hallmark: it fluctuates, but it does not run away.

Solving OU by the integrating factor

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.

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.

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.

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. Notice they settle into a band of half-width set by the stationary standard deviation \sigma/\sqrt{2\theta} — they fluctuate around \mu but never run away. Each run prints the \theta, \mu, \sigma it drew; Refresh for a fresh batch.