# Ornstein–Uhlenbeck process

A simulation with θ = 1.0, σ = 3 and μ = (0, 0). Initially at the position (10, 10), the particle tends to move to the central point μ.
A 3D simulation with θ = 1.0, σ = 3, μ = (0, 0, 0) and the initial position (10, 10, 10).

In mathematics, the Ornstein–Uhlenbeck process is a stochastic process with applications in financial mathematics and the physical sciences. Its original application in physics was as a model for the velocity of a massive Brownian particle under the influence of friction. It is named after Leonard Ornstein and George Eugene Uhlenbeck.

The Ornstein–Uhlenbeck process is a stationary Gauss–Markov process, which means that it is a Gaussian process, a Markov process, and is temporally homogeneous. In fact, it is the only nontrivial process that satisfies these three conditions, up to allowing linear transformations of the space and time variables.[1] Over time, the process tends to drift towards its mean function: such a process is called mean-reverting.

The process can be considered to be a modification of the random walk in continuous time, or Wiener process, in which the properties of the process have been changed so that there is a tendency of the walk to move back towards a central location, with a greater attraction when the process is further away from the center. The Ornstein–Uhlenbeck process can also be considered as the continuous-time analogue of the discrete-time AR(1) process.

## Definition

The Ornstein–Uhlenbeck process ${\displaystyle x_{t}}$ is defined by the following stochastic differential equation:

${\displaystyle dx_{t}=-\theta \,x_{t}\,dt+\sigma \,dW_{t}}$

where ${\displaystyle \theta >0}$ and ${\displaystyle \sigma >0}$ are parameters and ${\displaystyle W_{t}}$ denotes the Wiener process.[2][3][4]

${\displaystyle dx_{t}=\theta (\mu -x_{t})\,dt+\sigma \,dW_{t}}$

where ${\displaystyle \mu }$ is a constant. In financial mathematics, this is also known as the Vasicek model.[5]

The Ornstein–Uhlenbeck process is sometimes also written as a Langevin equation of the form

${\displaystyle {\frac {dx_{t}}{dt}}=-\theta \,x_{t}+\sigma \,\eta (t)}$

where ${\displaystyle \eta (t)}$, also known as white noise, stands in for the supposed derivative ${\displaystyle dW_{t}/dt}$ of the Wiener process.[6] However, ${\displaystyle dW_{t}/dt}$ does not exist because the Wiener process is nowhere differentiable, and so the Langevin equation is, strictly speaking, only heuristic.[7] In physics and engineering disciplines, it is nevertheless a common representation for the Ornstein–Uhlenbeck process and similar stochastic differential equations.

## Fokker–Planck equation representation

The Ornstein–Uhlenbeck process can also be described in terms of a probability density function, ${\displaystyle P(x,t)}$, which specifies the probability of finding the process in the state ${\displaystyle x}$ at time ${\displaystyle t}$.[8] This function satisfies the Fokker–Planck equation

${\displaystyle {\frac {\partial P}{\partial t}}=\theta {\frac {\partial }{\partial x}}(xP)+D{\frac {\partial ^{2}P}{\partial x^{2}}}}$

where ${\displaystyle D=\sigma ^{2}/2}$. This is a linear parabolic partial differential equation which can be solved by a variety of techniques. The transition probability ${\displaystyle P(x,t\mid x',t')}$ is a Gaussian with mean ${\displaystyle x'e^{-\theta (t-t')}}$ and variance ${\displaystyle {\frac {D}{\theta }}\left(1-e^{-2\theta (t-t')}\right)}$:

${\displaystyle P(x,t\mid x',t')={\sqrt {\frac {\theta }{2\pi D(1-e^{-2\theta (t-t')})}}}\exp \left[-{\frac {\theta }{2D}}{\frac {(x-x'e^{-\theta (t-t')})^{2}}{1-e^{-2\theta (t-t')}}}\right]}$

This gives the probability of the state ${\displaystyle x}$ occurring at time ${\displaystyle t}$ given initial state ${\displaystyle x'}$ at time ${\displaystyle t'. Equivalently, ${\displaystyle P(x,t\mid x',t')}$ is the solution of the Fokker-Planck equation with initial condition ${\displaystyle P(x,t')=\delta (x-x')}$.

## Mathematical properties

Assuming ${\displaystyle x_{0}}$ is constant, the mean is

${\displaystyle \operatorname {E} (x_{t})=x_{0}e^{-\theta t}+\mu (1-e^{-\theta t})}$

and the covariance is

${\displaystyle \operatorname {cov} (x_{s},x_{t})={\frac {\sigma ^{2}}{2\theta }}\left(e^{-\theta |t-s|}-e^{-\theta (t+s)}\right)}$

The Ornstein–Uhlenbeck process is an example of a Gaussian process that has a bounded variance and admits a stationary probability distribution, in contrast to the Wiener process; the difference between the two is in their "drift" term. For the Wiener process the drift term is constant, whereas for the Ornstein–Uhlenbeck process it is dependent on the current value of the process: if the current value of the process is less than the (long-term) mean, the drift will be positive; if the current value of the process is greater than the (long-term) mean, the drift will be negative. In other words, the mean acts as an equilibrium level for the process. This gives the process its informative name, "mean-reverting."

### Properties of sample paths

A temporally homogeneous Ornstein–Uhlenbeck process can be represented as a scaled, time-transformed Wiener process:

${\displaystyle x_{t}={\frac {\sigma }{\sqrt {2\theta }}}e^{-\theta t}W_{e^{2\theta t}}}$

where ${\displaystyle W_{t}}$ is the standard Wiener process.[1] Equivalently, with the change of variable ${\displaystyle s=e^{2\theta t}}$ this becomes

${\displaystyle W_{s}={\frac {\sqrt {2\theta }}{\sigma }}s^{1/2}x_{(\ln s)/(2\theta )},\qquad s>0}$

Using this mapping, one can translate known properties of ${\displaystyle W_{t}}$ into corresponding statements for ${\displaystyle x_{t}}$. For instance, the law of the iterated logarithm for ${\displaystyle W_{t}}$ becomes[1]

${\displaystyle \lim _{t\rightarrow 0}\sup {\frac {x_{t}}{\sqrt {(\sigma ^{2}/\theta )\ln t}}}=1,\quad {\text{with probability 1.}}}$

### Formal solution

The stochastic differential equation for ${\displaystyle x_{t}}$ can be formally solved by variation of parameters.[9] Writing

${\displaystyle f(x_{t},t)=x_{t}e^{\theta t}\,}$

we get

{\displaystyle {\begin{aligned}df(x_{t},t)&=\theta \,x_{t}\,e^{\theta t}\,dt+e^{\theta t}\,dx_{t}\\[6pt]&=e^{\theta t}\theta \,\mu \,dt+\sigma \,e^{\theta t}\,dW_{t}.\end{aligned}}}

Integrating from ${\displaystyle 0}$ to ${\displaystyle t}$ we get

${\displaystyle x_{t}e^{\theta t}=x_{0}+\int _{0}^{t}e^{\theta s}\theta \,\mu \,ds+\int _{0}^{t}\sigma \,e^{\theta s}\,dW_{s}\,}$

whereupon we see

${\displaystyle x_{t}=x_{0}\,e^{-\theta t}+\mu \,(1-e^{-\theta t})+\sigma \int _{0}^{t}e^{-\theta (t-s)}\,dW_{s}.\,}$

From this representation, the first moment (i.e. the mean) is shown to be

${\displaystyle \operatorname {E} (x_{t})=x_{0}e^{-\theta t}+\mu (1-e^{-\theta t})\!\ }$

assuming ${\displaystyle x_{0}}$ is constant. Moreover, the Itō isometry can be used to calculate the covariance function by

{\displaystyle {\begin{aligned}\operatorname {cov} (x_{s},x_{t})&=\operatorname {E} [(x_{s}-\operatorname {E} [x_{s}])(x_{t}-\operatorname {E} [x_{t}])]\\[5pt]&=\operatorname {E} \left[\int _{0}^{s}\sigma e^{\theta (u-s)}\,dW_{u}\int _{0}^{t}\sigma e^{\theta (v-t)}\,dW_{v}\right]\\[5pt]&=\sigma ^{2}e^{-\theta (s+t)}\operatorname {E} \left[\int _{0}^{s}e^{\theta u}\,dW_{u}\int _{0}^{t}e^{\theta v}\,dW_{v}\right]\\[5pt]&={\frac {\sigma ^{2}}{2\theta }}\,e^{-\theta (s+t)}(e^{2\theta \min(s,t)}-1)\\[5pt]&={\frac {\sigma ^{2}}{2\theta }}\left(e^{-\theta |t-s|}-e^{-\theta (t+s)}\right).\end{aligned}}}

### Numerical sampling

By using discretely sampled data at time intervals of width ${\displaystyle t}$, the maximum likelihood estimators for the parameters of the Ornstein–Uhlenbeck process are asymptotically normal to their true values.[10] More precisely,[failed verification]

${\displaystyle {\sqrt {n}}\left({\begin{pmatrix}{\widehat {\theta }}_{n}\\{\widehat {\mu }}_{n}\\{\widehat {\sigma }}_{n}\end{pmatrix}}-{\begin{pmatrix}\theta \\\mu \\\sigma \end{pmatrix}}\right){\xrightarrow {d}}\ {\mathcal {N}}\left({\begin{pmatrix}0\\0\\0\end{pmatrix}},{\begin{pmatrix}{\frac {e^{2t\theta }-1}{t^{2}}}&0&{\frac {\sigma ^{2}(e^{2t\theta }-1-2t\theta )}{t^{2}\theta }}\\0&{\frac {\sigma ^{2}\left(e^{t\theta }+1\right)}{2\left(e^{t\theta }-1\right)\theta }}&0\\{\frac {\sigma ^{2}(e^{2t\theta }-1-2t\theta )}{t^{2}\theta }}&0&{\frac {\sigma ^{4}\left[\left(e^{2t\theta }-1\right)^{2}+2t^{2}\theta ^{2}\left(e^{2t\theta }+1\right)+4t\theta \left(e^{2t\theta }-1\right)\right]}{t^{2}\left(e^{2t\theta }-1\right)\theta ^{2}}}\end{pmatrix}}\right)}$

three sample paths of different OU-processes with θ = 1, μ = 1.2, σ = 0.3:
blue: initial value a = 0 (a.s.)
green: initial value a = 2 (a.s.)
red: initial value normally distributed so that the process has invariant measure

## Scaling limit interpretation

The Ornstein–Uhlenbeck process can be interpreted as a scaling limit of a discrete process, in the same way that Brownian motion is a scaling limit of random walks. Consider an urn containing ${\displaystyle n}$ blue and yellow balls. At each step a ball is chosen at random and replaced by a ball of the opposite colour. Let ${\displaystyle X_{n}}$ be the number of blue balls in the urn after ${\displaystyle n}$ steps. Then ${\displaystyle {\frac {X_{[nt]}-n/2}{\sqrt {n}}}}$ converges in law to an Ornstein–Uhlenbeck process as ${\displaystyle n}$ tends to infinity.

## Application in physical sciences

The Ornstein–Uhlenbeck process is a prototype of a noisy relaxation process. Consider for example a Hookean spring with spring constant ${\displaystyle k}$ whose dynamics is highly overdamped with friction coefficient ${\displaystyle \gamma }$. In the presence of thermal fluctuations with temperature ${\displaystyle T}$, the length ${\displaystyle x(t)}$ of the spring will fluctuate stochastically around the spring rest length ${\displaystyle x_{0}}$; its stochastic dynamic is described by an Ornstein–Uhlenbeck process with:

{\displaystyle {\begin{aligned}\theta &=k/\gamma ,\\\mu &=x_{0},\\\sigma &={\sqrt {2k_{B}T/\gamma }},\end{aligned}}}

where ${\displaystyle \sigma }$ is derived from the Stokes–Einstein equation ${\displaystyle D=\sigma ^{2}/2=k_{B}T/\gamma }$ for the effective diffusion constant.

In physical sciences, the stochastic differential equation of an Ornstein–Uhlenbeck process is rewritten as a Langevin equation

${\displaystyle {\dot {x}}(t)=-{\frac {k}{\gamma }}(x(t)-x_{0})+\xi (t)}$

where ${\displaystyle \xi (t)}$ is white Gaussian noise with ${\displaystyle \langle \xi (t_{1})\xi (t_{2})\rangle =2k_{B}T/\gamma \,\delta (t_{1}-t_{2}).}$ Fluctuations are correlated as

${\displaystyle \langle (x(t_{0})-x_{0})(x(t_{0}+t)-x_{0})\rangle ={\frac {k_{B}T}{k}}\exp(-|t|/\tau )}$

with correlation time ${\displaystyle \tau =\gamma /k}$.

At equilibrium, the spring stores an average energy ${\displaystyle \langle E\rangle =k\langle (x-x_{0})^{2}\rangle /2=k_{B}T/2}$ in accordance with the equipartition theorem.

## Application in financial mathematics

The Ornstein–Uhlenbeck process is one of several approaches used to model (with modifications) interest rates, currency exchange rates, and commodity prices stochastically. The parameter ${\displaystyle \mu }$ represents the equilibrium or mean value supported by fundamentals; ${\displaystyle \sigma }$ the degree of volatility around it caused by shocks, and ${\displaystyle \theta }$ the rate by which these shocks dissipate and the variable reverts towards the mean. One application of the process is a trading strategy known as pairs trade.[11][12][13]

## Application in evolutionary biology

The Ornstein–Uhlenbeck process has been proposed as an improvement over a Brownian motion model for modeling the change in organismal phenotypes over time.[14] A Brownian motion model implies that the phenotype can move without limit, whereas for most phenotypes natural selection imposes a cost for moving too far in either direction.

## Generalizations

It is possible to extend Ornstein–Uhlenbeck processes to processes where the background driving process is a Lévy process (instead of a simple Brownian motion).[clarification needed] These processes are widely studied by Ole Barndorff-Nielsen and Neil Shephard,[citation needed] and others.[citation needed]

In addition, in finance, stochastic processes are used where the volatility increases for larger values of ${\displaystyle X}$. In particular, the CKLS (Chan–Karolyi–Longstaff–Sanders) process[15] with the volatility term replaced by ${\displaystyle \sigma \,x^{\gamma }\,dW_{t}}$ can be solved in closed form for ${\displaystyle \gamma =1}$, as well as for ${\displaystyle \gamma =0}$, which corresponds to the conventional OU process. Another special case is ${\displaystyle \gamma =1/2}$, which corresponds to the Cox–Ingersoll–Ross model (CIR-model).

### Higher dimensions

A multi-dimensional version of the Ornstein–Uhlenbeck process, denoted by the N-dimensional vector ${\displaystyle \mathbf {x} _{t}}$, can be defined from

${\displaystyle d\mathbf {x} _{t}=-{\boldsymbol {\beta }}\,\mathbf {x} _{t}\,dt+{\boldsymbol {\sigma }}\,d\mathbf {W} _{t}.}$

where ${\displaystyle \mathbf {W} _{t}}$ is an N-dimensional Wiener process, and ${\displaystyle {\boldsymbol {\beta }}}$ and ${\displaystyle {\boldsymbol {\sigma }}}$ are constant N×N matrices.[16] The solution is

${\displaystyle \mathbf {x} _{t}=e^{-{\boldsymbol {\beta }}t}\mathbf {x} _{0}+\int _{0}^{t}e^{-{\boldsymbol {\beta }}(t-t')}{\boldsymbol {\sigma }}\,d\mathbf {W} _{t'}}$

and the mean is

${\displaystyle \operatorname {E} (\mathbf {x} _{t})=e^{-{\boldsymbol {\beta }}t}\operatorname {E} (\mathbf {x} _{0}).}$

Note that these expressions make use of the matrix exponential.

The process can also be described in terms of the probability density function ${\displaystyle P(\mathbf {x} ,t)}$, which satisfies the Fokker–Planck equation[17]

${\displaystyle {\frac {\partial P}{\partial t}}=\sum _{i,j}\beta _{ij}{\frac {\partial }{\partial x_{i}}}(x_{j}P)+\sum _{i,j}D_{ij}{\frac {\partial ^{2}P}{\partial x_{i}\,\partial x_{j}}}.}$

where the matrix ${\displaystyle {\boldsymbol {D}}}$ with components ${\displaystyle D_{ij}}$ is defined by ${\displaystyle {\boldsymbol {D}}={\boldsymbol {\sigma }}{\boldsymbol {\sigma }}^{T}/2}$. As for the 1d case, the process is a linear transformation of Gaussian random variables, and therefore itself must be Gaussian. Because of this, the transition probability ${\displaystyle P(\mathbf {x} ,t\mid \mathbf {x} ',t')}$ is a Gaussian which can be written down explicitly. If the real parts of the eigenvalues of ${\displaystyle {\boldsymbol {\beta }}}$ are larger than zero, a stationary solution ${\displaystyle P_{\text{st}}(\mathbf {x} )}$ moreover exists, given by

${\displaystyle P_{\text{st}}(\mathbf {x} )=(2\pi )^{-N/2}(\det {\boldsymbol {\omega }})^{-1/2}\exp \left(-{\frac {1}{2}}\mathbf {x} ^{T}{\boldsymbol {\omega }}^{-1}\mathbf {x} \right)}$

where the matrix ${\displaystyle {\boldsymbol {\omega }}}$ is determined from ${\displaystyle {\boldsymbol {\beta }}{\boldsymbol {\omega }}+{\boldsymbol {\omega }}{\boldsymbol {\beta }}^{T}=2{\boldsymbol {D}}}$.[18]

## Notes

1. ^ a b c Doob, J.L. (April 1942). "The Brownian Movement and Stochastic Equations". Annals of Mathematics. 43 (2): 351–369. doi:10.2307/1968873. JSTOR 1968873.
2. ^ Karatzas, Ioannis; Shreve, Steven E. (1991), Brownian Motion and Stochastic Calculus (2nd ed.), Springer-Verlag, p. 358, ISBN 978-0-387-97655-6
3. ^ Gard, Thomas C. (1988), Introduction to Stochastic Differential Equations, Marcel Dekker, p. 115, ISBN 978-0-8247-7776-0
4. ^ Gardiner, C.W. (1985), Handbook of Stochastic Methods (2nd ed.), Springer-Verlag, p. 106, ISBN 978-0-387-15607-1
5. ^ Björk, Tomas (2009). Arbitrage Theory in Continuous Time (3rd ed.). Oxford University Press. pp. 375, 381. ISBN 978-0-19-957474-2.
6. ^ Risken (1984)
7. ^ Lawler, Gregory F. (2006). Introduction to Stochastic Processes (2nd ed.). Chapman & Hall/CRC. ISBN 978-1584886518.CS1 maint: ref=harv (link)
8. ^ Risken, H. (1984), The Fokker-Planck Equation: Methods of Solution and Application, Springer-Verlag, pp. 99–100, ISBN 978-0-387-13098-9
9. ^ Gardiner (1985) p. 106
10. ^ Aït-Sahalia, Y. (April 2002). "Maximum Likelihood Estimation of Discretely Sampled Diffusion: A Closed-Form Approximation Approach". Econometrica. 70 (1): 223–262. doi:10.1111/1468-0262.00274.
11. ^ Optimal Mean-Reversion Trading: Mathematical Analysis and Practical Applications. World Scientific Publishing Co. 2016. ISBN 978-9814725910.