OrnsteinUhlenbeckProcess[μ,σ,θ]
represents a stationary Ornstein–Uhlenbeck process with long-term mean μ, volatility
, and mean reversion speed θ.
OrnsteinUhlenbeckProcess[μ,σ,θ,x0]
represents an Ornstein–Uhlenbeck process with initial condition x0.
OrnsteinUhlenbeckProcess
OrnsteinUhlenbeckProcess[μ,σ,θ]
represents a stationary Ornstein–Uhlenbeck process with long-term mean μ, volatility
, and mean reversion speed θ.
OrnsteinUhlenbeckProcess[μ,σ,θ,x0]
represents an Ornstein–Uhlenbeck process with initial condition x0.
Details
- OrnsteinUhlenbeckProcess is a continuous-time and continuous-state random process.
- OrnsteinUhlenbeckProcess is also known as Vasicek model.
- The state
of an Ornstein–Uhlenbeck process satisfies an Ito differential equation
, where
follows a standard WienerProcess[]. - The initial value for OrnsteinUhlenbeckProcess[μ,σ,θ] is random and follows NormalDistribution[μ,σ/
]. - OrnsteinUhlenbeckProcess[μ,σ,θ] value at time t follows NormalDistribution[μ,σ/
]. - OrnsteinUhlenbeckProcess[μ,σ,θ,x0] value at time t follows NormalDistribution[ μ+(x0-μ)exp(-θ t),
]. - OrnsteinUhlenbeckProcess allows μ and x0 to be any real numbers and σ and θ to be any positive real numbers.
- OrnsteinUhlenbeckProcess can be used with such functions as Mean, PDF, Probability, and RandomFunction.
Examples
open all close allBasic Examples (3)
Simulate an Ornstein–Uhlenbeck process with a random initial condition:
data = RandomFunction[OrnsteinUhlenbeckProcess[0, .1, .3], {0, 10, .1}]ListLinePlot[data, Filling -> Axis]data = RandomFunction[OrnsteinUhlenbeckProcess[0, .1, .3, 1], {0, 20, .1}];ListLinePlot[data, Filling -> Axis]Mean[OrnsteinUhlenbeckProcess[μ, σ, θ][t]]Variance[OrnsteinUhlenbeckProcess[μ, σ, θ][t]]Mean[OrnsteinUhlenbeckProcess[μ, σ, θ, x][t]]Variance[OrnsteinUhlenbeckProcess[μ, σ, θ, x][t]]CovarianceFunction[OrnsteinUhlenbeckProcess[μ, σ, θ], s, t]Plot3D[CovarianceFunction[OrnsteinUhlenbeckProcess[0, 1, .2], s, t], {s, 0, 10}, {t, 0, 10}, ColorFunction -> "Rainbow"]CovarianceFunction[OrnsteinUhlenbeckProcess[μ, σ, θ, x], s, t]Plot3D[CovarianceFunction[OrnsteinUhlenbeckProcess[0, 1, .2, 1], s, t], {s, 0, 10}, {t, 0, 10}, ColorFunction -> "Rainbow"]Scope (12)
Basic Uses (7)
Simulate an ensemble of paths:
data = RandomFunction[OrnsteinUhlenbeckProcess[.3, .5, .4], {0, 1, 0.01}, 4]ListLinePlot[data, Filling -> Axis]Simulate with arbitrary precision:
RandomFunction[OrnsteinUhlenbeckProcess[1 / 10, 1 / 3, 1 / 2], {0, 1, 1 / 4}, WorkingPrecision -> 20]["Path"]Compare paths for different values of the mean reversion speed:
sample[θ_] := (SeedRandom[14];RandomFunction[OrnsteinUhlenbeckProcess[0, 1, θ], {0, 1, .01}])ListStepPlot[sample[#], Filling -> Axis, PlotLabel -> StringJoin["θ = ", ToString[#]]]& /@ {.1, 1, 10}Simulate the process for various starting points:
points = {-2, -1, 0, 1};
sample[x_] := RandomFunction[OrnsteinUhlenbeckProcess[0, .5, .3, x], {0, 10, 0.1}];ListLinePlot[sample[#]& /@ points, PlotRange -> All, Filling -> Axis, PlotLegends -> (StringJoin["x = ", ToString[#]]& /@ points)]data = RandomFunction[OrnsteinUhlenbeckProcess[0.8, 1, .2], {0, 1000, 0.01}];EstimatedProcess[data, OrnsteinUhlenbeckProcess[μ, σ, θ]]The following estimation methods are available:
m = {"LeastSquares", "MaximumConditionalLikelihood"};FindProcessParameters[data, OrnsteinUhlenbeckProcess[μ, σ, θ, x0], ProcessEstimator -> #]& /@ mCorrelationFunction[OrnsteinUhlenbeckProcess[μ, σ, θ], s, t]CorrelationFunction[OrnsteinUhlenbeckProcess[μ, σ, θ, Subscript[x, 0]], s, t]Absolute correlation function:
AbsoluteCorrelationFunction[OrnsteinUhlenbeckProcess[μ, σ, θ], s, t]AbsoluteCorrelationFunction[OrnsteinUhlenbeckProcess[μ, σ, θ, Subscript[x, 0]], s, t]Process Slice Properties (5)
Univariate SliceDistribution:
OrnsteinUhlenbeckProcess[μ, σ, θ][t]Probability density function does not depend on time:
Plot[PDF[OrnsteinUhlenbeckProcess[0, 1, 1 / 3][t], x], {x, -3, 3}, Filling -> Axis]PDF[OrnsteinUhlenbeckProcess[μ, σ, θ][t], x]SliceDistribution[OrnsteinUhlenbeckProcess[μ, σ, θ, x0], t]Probability density function does depend on time:
Plot[Evaluate@Table[PDF[OrnsteinUhlenbeckProcess[0, 1, .5, 2][t], x], {t, {1 / 2, 1, 2}}], {x, -3, 3}, Filling -> Axis, PlotLegends -> {"t = 1/2", "t = 1", "t = 2"}]PDF[OrnsteinUhlenbeckProcess[μ, σ, θ, Subscript[x, 0]][t], x]Multivariate slice distribution:
SliceDistribution[OrnsteinUhlenbeckProcess[0, 1, 2], {s, t}]SliceDistribution[OrnsteinUhlenbeckProcess[0, 1, 2, 1], {1, 2, 3}]Mean[%]Compute the expectation of an expression:
Expectation[x[t] + x[t] ^ 2, xOrnsteinUhlenbeckProcess[μ, σ, θ]]//SimplifyCalculate the probability of an event:
Probability[x[t] > -1, xOrnsteinUhlenbeckProcess[μ, σ, θ]]Skewness and kurtosis are constant:
Skewness[OrnsteinUhlenbeckProcess[μ, σ, θ][t]]Skewness[OrnsteinUhlenbeckProcess[μ, σ, θ, Subscript[x, 0]][t]]Kurtosis[OrnsteinUhlenbeckProcess[μ, σ, θ][t]]Kurtosis[OrnsteinUhlenbeckProcess[μ, σ, θ, Subscript[x, 0]][t]]Moment[OrnsteinUhlenbeckProcess[μ, σ, θ][t], r]CharacteristicFunction[OrnsteinUhlenbeckProcess[μ, σ, θ][t], w]MomentGeneratingFunction[OrnsteinUhlenbeckProcess[μ, σ, θ][t], w]CentralMoment and its generating function:
CentralMoment[OrnsteinUhlenbeckProcess[μ, σ, θ][t], r]CentralMomentGeneratingFunction[OrnsteinUhlenbeckProcess[μ, σ, θ][t], w]FactorialMoment has no closed form for symbolic order:
FactorialMoment[OrnsteinUhlenbeckProcess[μ, σ, θ][t], r]FactorialMoment[OrnsteinUhlenbeckProcess[μ, σ, θ][t], 3]FactorialMomentGeneratingFunction[OrnsteinUhlenbeckProcess[μ, σ, θ][t], w]Cumulant and its generating function:
Cumulant[OrnsteinUhlenbeckProcess[μ, σ, θ][t], r]CumulantGeneratingFunction[OrnsteinUhlenbeckProcess[μ, σ, θ][t], w]Generalizations & Extensions (1)
Quadratic transformation of an Ornstein–Uhlenbeck process:
𝒫 = TransformedProcess[p[2t + 1] ^ 2 + 3, pOrnsteinUhlenbeckProcess[0, 1, 0.2], t];Simulate the transformed process:
data = RandomFunction[𝒫, {0, 30, 0.1}, 3];ListLinePlot[data, PlotRange -> All]Mean and variance functions are constant:
{Mean[𝒫[t]], Variance[𝒫[t]]}Verify the results by simulating a slice of the process:
data1 = RandomVariate[𝒫[1.9], 2000];{Mean[data1], Variance[data1]}Properties & Relations (9)
OrnsteinUhlenbeckProcess starting at a random value is weakly stationary:
WeakStationarity[OrnsteinUhlenbeckProcess[μ, σ, θ]]The process starting at a fixed value is not weakly stationary:
WeakStationarity[OrnsteinUhlenbeckProcess[μ, σ, θ, a]]Power spectrum of a stationary Ornstein–Uhlenbeck process:
FourierTransform[CovarianceFunction[OrnsteinUhlenbeckProcess[μ, σ, θ], h], h, ω, FourierParameters -> {1, 1}]Ornstein–Uhlenbeck process has a well-defined StationaryDistribution:
StationaryDistribution[OrnsteinUhlenbeckProcess[μ, σ, θ]]StationaryDistribution[OrnsteinUhlenbeckProcess[μ, σ, θ, a]]Ornstein–Uhlenbeck process does not have independent increments:
proc = OrnsteinUhlenbeckProcess[μ, σ, θ];Expectation[(x[t2] - x[t1])(x[t4] - x[t3]), xproc, Assumptions -> 0 < t1 < t2 < t3 < t4]//SimplifyCompare to the product of expectations:
Expectation[(x[t2] - x[t1]), xproc, Assumptions -> 0 < t1 < t2] * Expectation[(x[t4] - x[t3]), xproc, Assumptions -> 0 < t3 < t4]% === %%proc = OrnsteinUhlenbeckProcess[μ, σ, θ, Subscript[x, 0]];Expectation[(x[t2] - x[t1])(x[t4] - x[t3]), xproc, Assumptions -> 0 < t1 < t2 < t3 < t4]//SimplifyCompare to the product of expectations:
Expectation[(x[t2] - x[t1]), xproc, Assumptions -> 0 < t1 < t2] * Expectation[(x[t4] - x[t3]), xproc, Assumptions -> 0 < t3 < t4]% === %%Conditional cumulative distribution function:
Table[Plot[Evaluate@Probability[(x[5] <= Subscript[x, 2])(x[2] == Subscript[x, 1]), xOrnsteinUhlenbeckProcess[0, 1, .2]], {Subscript[x, 2], -4, 6}, Filling -> Axis, PlotLabel -> StringJoin["SubscriptBox[x, 1] = ", ToString[Subscript[x, 1]]]], {Subscript[x, 1], {-1.5, -.4, 1.3, 3}}]Probability[(x[Subscript[t, 2]] ≤ Subscript[x, 2])(x[Subscript[t, 1]] == Subscript[x, 1]), xOrnsteinUhlenbeckProcess[μ, σ, θ], Assumptions -> 0 < Subscript[t, 1] < Subscript[t, 2] && 0 ≤ Subscript[x, 1] ≤ Subscript[t, 1] && 0 ≤ Subscript[x, 2] ≤ Subscript[t, 2]]//SimplifyAn Ornstein–Uhlenbeck process with a fixed initial condition is a special ItoProcess:
ItoProcess[OrnsteinUhlenbeckProcess[μ, σ, θ, Subscript[x, 0]]]As well as StratonovichProcess:
StratonovichProcess[OrnsteinUhlenbeckProcess[μ, σ, θ, Subscript[x, 0]]]Ornstein–Uhlenbeck process is a solution of the stochastic differential equation
:
μ = 1.2;σ = 0.3;θ = 1;T = 5;noisysol = RandomFunction[OrnsteinUhlenbeckProcess[μ, σ, θ, 2], {0, T, 0.01}, 10 ^ 2];
meanFunction = TimeSeriesThread[Mean, noisysol];Show[ListLinePlot[noisysol, PlotStyle -> Directive[Opacity[.1]]], ListLinePlot[meanFunction, PlotStyle -> Directive[Black, Thick]]]Compare with the corresponding smooth solution:
smoothsol = NDSolve[{P'[t] == θ(μ - P[t]), P[0] == 2}, P, {t, 0, T}]Plot[P[t] /. smoothsol, {t, 0, T}, PlotRange -> {0.5, 2.5}]Ornstein–Uhlenbeck with three arguments is mean ergodic:
proc = OrnsteinUhlenbeckProcess[μ, σ, θ];The process is weakly stationary:
WeakStationarity[proc]Calculate absolute correlation function:
abscorr[h_] = AbsoluteCorrelationFunction[proc, h]Find value of the strip integral:
int[t_] = 1 / (2 * t)Integrate[(1 - Abs[u] / (2 * t))abscorr[u], {u, -2 * t, 2 * t}, Assumptions -> t > 0 && θ > 0]The process is mean ergodic only for μ=0:
Limit[int[t], t -> ∞, Assumptions -> θ > 0]Ornstein–Uhlenbeck process at integer times behaves as a first-order ARProcess:
ou = OrnsteinUhlenbeckProcess[μ, σ, θ];Create moment equations to find parameters for an ARProcess:
momEq = And[Mean[ou[t]] == Mean[ARProcess[c, {a}, b][t]],
CovarianceFunction[ou, h] == CovarianceFunction[ARProcess[c, {a}, b], h]]{sol} = Solve[And[(momEq /. h -> 0), momEq /. h -> 1], {a, b, c}, Reals]//FullSimplify[#, θ != 0 && σ > 0]&Create an ARProcess:
ar = ARProcess[c, {a}, b] /. solMean /@ {ou[t], ar[t]}//FullSimplifyCovarianceFunction[#, h]& /@ {ou, ar}//FullSimplifyNeat Examples (3)
Simulate an Ornstein–Uhlenbeck process in two dimensions:
SeedRandom[19];sample = RandomFunction[OrnsteinUhlenbeckProcess[-1, 1, .3], {0, 1, .001}, 2]["ValueList"];ListLinePlot[Transpose@sample, ColorFunction -> "FallColors"]Simulate an Ornstein–Uhlenbeck process in three dimensions:
SeedRandom[123];
sample = Table[RandomFunction[OrnsteinUhlenbeckProcess[0, 1, 1 / 4, 0], {0, 1, 0.01}, 3]["ValueList"], {8}];Graphics3D@Table[{ColorData["SolarColors"][RandomReal[]], Tube@Line@sample[[i]]}, {i, 8}]Simulate 500 paths from an Ornstein–Uhlenbeck process:
data = RandomFunction[OrnsteinUhlenbeckProcess[0, 1, 1 / 3, 2], {0, 1, .01}, 500];Take a slice at 1 and visualize its distribution:
sd = data["SliceData", 1];cf = ColorData["Rainbow"];
sliced = BarChart[Last[#], Axes -> False, BarOrigin -> Left, AspectRatio -> 4, ChartStyle -> (cf /@ Rescale[MovingAverage[First[#], 2], {Min[sd], Max[sd]}, {0, 1}]), ImageSize -> 68]&[HistogramList[sd, {Range[-3, 6, .3]}]];Plot paths and histogram distribution of the slice distribution at 1:
ListLinePlot[data, ImageSize -> 400, PlotRange -> All,
AspectRatio -> 3 / 4, Epilog -> Inset[sliced, {1.01, 0}, {0, 8}], PlotStyle -> (cf /@ Rescale[sd]), BaseStyle -> Directive[Thin, Opacity[0.5]], PlotRangePadding -> {{0, .25}, {.5, .5}}]Related Guides
History
Text
Wolfram Research (2012), OrnsteinUhlenbeckProcess, Wolfram Language function, https://reference.wolfram.com/language/ref/OrnsteinUhlenbeckProcess.html.
CMS
Wolfram Language. 2012. "OrnsteinUhlenbeckProcess." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OrnsteinUhlenbeckProcess.html.
APA
Wolfram Language. (2012). OrnsteinUhlenbeckProcess. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OrnsteinUhlenbeckProcess.html
BibTeX
@misc{reference.wolfram_2026_ornsteinuhlenbeckprocess, author="Wolfram Research", title="{OrnsteinUhlenbeckProcess}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/OrnsteinUhlenbeckProcess.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_ornsteinuhlenbeckprocess, organization={Wolfram Research}, title={OrnsteinUhlenbeckProcess}, year={2012}, url={https://reference.wolfram.com/language/ref/OrnsteinUhlenbeckProcess.html}, note=[Accessed: 12-June-2026]}