Introduction

Some quantities wander freely — stock prices climb or plunge with no ceiling pulling them back. Others seem anchored: they drift, sometimes far, but then snap back toward a familiar level. Interest rates do this. The spread between two correlated stocks does this. The velocity of a particle in a fluid does this.

The Ornstein-Uhlenbeck (OU) process is the simplest mathematical model of that anchored wandering. Proposed by Leonard Ornstein and George Uhlenbeck in 1930 to describe Brownian motion with friction, it turns out to describe an enormous range of phenomena.

The core idea is a restoring force: wherever the process is right now, it is being nudged — proportionally — back toward a long-run mean μ\mu. Add random noise on top of that nudge, and you get a process that can stray but never wanders to infinity.

Unlike a pure random walk, the OU process has a well-defined stationary distribution. Leave it running long enough and it settles into a bell curve centered at μ\mu. That property — stationarity — is what makes it useful anywhere you expect equilibrium.

Try It

Adjust the three parameters and watch the simulated path evolve in real time. The dashed line is the long-run mean μ\mu; the shaded band is one standard deviation of the stationary distribution (±σ/2θ\pm \sigma / \sqrt{2\theta}).

<!-- {{c_ou_title}} -->
<div class="controls">
  <label>{{lbl_theta}} <input id="theta" type="range" min="0.05" max="3" step="0.05" value="0.5"></label>
  <span id="theta-val" class="val">0.50</span>
  <label>{{lbl_sigma}} <input id="sigma" type="range" min="0.05" max="2" step="0.05" value="0.5"></label>
  <span id="sigma-val" class="val">0.50</span>
  <label>{{lbl_mu}} <input id="mu" type="range" min="-2" max="2" step="0.1" value="0"></label>
  <span id="mu-val" class="val">0.00</span>
</div>
<canvas id="chart" width="560" height="240"></canvas>
<div class="status" id="status"></div>
<div class="btns">
  <button id="btn-run" type="button">{{btn_run}}</button>
  <button id="btn-reset" type="button" class="ghost">{{btn_reset}}</button>
</div>
/* {{c_ou_style}} */
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.controls { display: grid; grid-template-columns: auto 1fr 3rem; gap: .3rem .5rem; align-items: center; margin-bottom: .6rem; }
label { font-size: .82rem; font-weight: 600; color: #1d3557; white-space: nowrap; }
input[type=range] { width: 100%; accent-color: #1d3557; }
.val { font-size: .82rem; font-variant-numeric: tabular-nums; color: #444; text-align: right; }
canvas { border: 1px solid #cdd9e3; border-radius: 8px; width: 100%; display: block; background: #f8fafc; }
.status { font-size: .9rem; font-weight: 600; margin: .4rem 0; min-height: 1.3em; color: #1d3557; }
.btns { display: flex; gap: .5rem; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
         background: #1d3557; color: #fff; border-radius: 8px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
// Code not found

Notice how increasing θ\theta (the reversion speed) makes the path cling more tightly to the mean — large excursions are damped quickly. Increasing σ\sigma (volatility) widens the band and makes the path choppier, but the pull back is still there. Set θ\theta near zero and the path becomes almost a pure random walk — drifting with no restoring force.

The Math

The OU process XtX_t satisfies the stochastic differential equation (SDE):

dXt=θ(μXt)dt+σdWtdX_t = \theta(\mu - X_t)\,dt + \sigma\,dW_t

where θ>0\theta > 0 is the speed of reversion, μ\mu is the long-run mean, σ>0\sigma > 0 is the volatility, and WtW_t is standard Brownian motion.

Key results (all follow from solving the SDE exactly):

  • Exact solution: Xt=μ+(X0μ)eθt+σ0teθ(ts)dWsX_t = \mu + (X_0 - \mu)e^{-\theta t} + \sigma \int_0^t e^{-\theta(t-s)}\,dW_s. The deterministic part decays exponentially toward μ\mu; the stochastic part adds Gaussian noise.
  • Conditional mean: E[XtX0]=μ+(X0μ)eθt\mathbb{E}[X_t \mid X_0] = \mu + (X_0 - \mu)e^{-\theta t}. The process "remembers" its starting point, but that memory fades at rate θ\theta.
  • Conditional variance: Var(XtX0)=σ22θ(1e2θt)\operatorname{Var}(X_t \mid X_0) = \frac{\sigma^2}{2\theta}(1 - e^{-2\theta t}), growing from 00 to σ2/(2θ)\sigma^2/(2\theta).
  • Stationary distribution: as tt \to \infty, XtN ⁣(μ,σ22θ)X_t \sim \mathcal{N}\!\left(\mu,\, \frac{\sigma^2}{2\theta}\right). The process is ergodic — time averages equal ensemble averages.
  • Half-life of reversion: the time for half the gap between X0X_0 and μ\mu to close on average is t1/2=ln(2)/θt_{1/2} = \ln(2)/\theta.

The OU process is the only time-homogeneous process that is simultaneously Gaussian, Markov, and stationary. That uniqueness theorem (proved by Doob in 1942) explains why it appears in so many different fields under so many different names — the Vasicek model in interest rates, the Langevin equation in physics, the AR(1) process in discrete-time statistics.

Where It Matters

The restoring-force idea surfaces wherever a system has an equilibrium it keeps returning to:

  • Interest-rate modeling: the Vasicek model (1977) is the OU process applied to short-term rates — calibrated to market data, it prices bonds and interest-rate derivatives. Rates can rise or fall, but monetary policy acts as the restoring force.
  • Pairs trading / statistical arbitrage: two correlated stocks (say, two airlines) often move together. The spread between them is approximately OU. Traders buy the spread when it is wide (expecting it to narrow) and sell when it is tight — the entire strategy rests on mean reversion.
  • Physics — Brownian motion with friction: Ornstein and Uhlenbeck's original 1930 application. A particle in a fluid is pushed by random molecular collisions (noise) and slowed by viscous drag (restoring force). The velocity is exactly OU.
  • Biology and neuroscience: membrane potentials of neurons between spikes, population sizes around a carrying capacity, and hormone levels throughout the day all exhibit mean-reverting dynamics modeled by OU-type equations.
  • Commodities and energy: natural gas prices, electricity spot prices, and agricultural commodities are mean-reverting because high prices attract supply and depress demand, pulling prices back down.

Understanding the OU process is the entry point to a whole family of models — Hull-White rates, the Heston volatility model, and Bayesian inference on time series all rely on the same underlying math.

Conclusion

The Ornstein-Uhlenbeck process answers a deceptively simple question: what happens when randomness is paired with a restoring force? The answer — a Gaussian, ergodic, stationary process — turns out to be exactly what you need to model interest rates, particle velocities, market spreads, and biological rhythms.

Its three parameters are transparent: θ\theta controls how fast the system "forgets" deviations from μ\mu; σ\sigma controls how noisy the path is; and μ\mu is the level everything gravitates toward. Calibrate those from data and you have a working model of almost any mean-reverting phenomenon.

The next time you see a spread, a rate, or a price that wanders but always returns — that is the OU process at work, quietly pulling everything back toward equilibrium. See also Bayesian inference for how such models are fitted to real data.

Share this article

Pick a channel — or use your device's native share sheet.

Comments

Loading comments...

https://www.kipuhub.com/en/article/ornstein-uhlenbeck-meanrev/Content licensed under CC BY-NC 4.0.