WienerProcess[μ,σ]
represents a Wiener process with a drift μ and volatility σ.
represents a standard Wiener process with drift 0 and volatility 1.
WienerProcess
WienerProcess[μ,σ]
represents a Wiener process with a drift μ and volatility σ.
represents a standard Wiener process with drift 0 and volatility 1.
Details
- WienerProcess is also known as Brownian motion, a continuous-time random walk, or integrated white Gaussian noise.
- WienerProcess is a continuous-time and continuous-state random process.
- The state at time t follows NormalDistribution[μ t,σ
]. - The parameter μ can be any real number and the parameter σ can be any positive real number.
- WienerProcess can be used with such functions as Mean, PDF, Probability, and RandomFunction.
Examples
open all close allBasic Examples (3)
data = RandomFunction[WienerProcess[.3, .5], {0, 1, 0.01}]ListLinePlot[%, Filling -> Axis]Mean[WienerProcess[μ, σ][t]]Variance[WienerProcess[μ, σ][t]]CovarianceFunction[WienerProcess[μ, σ], s, t]CovarianceFunction[WienerProcess[], s, t]Plot3D[CovarianceFunction[WienerProcess[], s, t], {s, 0, 5}, {t, 0, 5}, ColorFunction -> "Rainbow"]Scope (12)
Basic Uses (7)
Simulate an ensemble of paths:
data = RandomFunction[WienerProcess[.3, .5], {0, 1, 0.01}, 4]ListLinePlot[data, Filling -> Axis]Simulate with arbitrary precision:
RandomFunction[WienerProcess[1 / 10, 1 / 3], {0, 1, 1 / 4}, WorkingPrecision -> 20]["Path"]Compare paths for different values of the drift parameter:
sample[μ_] := (SeedRandom[14];RandomFunction[WienerProcess[μ, 1], {0, 1, .01}])ListStepPlot[sample[#], Filling -> Axis, PlotLabel -> StringJoin["μ = ", ToString[#]]]& /@ {-2, 0, 2}Compare paths for different values of the volatility parameter:
sample[σ_] := (SeedRandom[4];RandomFunction[WienerProcess[0, σ], {0, 1, .01}])ListStepPlot[sample[#], Filling -> Axis, PlotRange -> {-1, 3}, PlotLabel -> StringJoin["σ = ", ToString[#]]]& /@ {.5, 1, 1.4}data = RandomFunction[WienerProcess[.4, .7], {0, 100, 0.01}];EstimatedProcess[data, WienerProcess[μ, σ]]CorrelationFunction[WienerProcess[μ, σ], s, t]Absolute correlation function:
AbsoluteCorrelationFunction[WienerProcess[μ, σ], s, t]Process Slice Properties (5)
Univariate SliceDistribution:
SliceDistribution[WienerProcess[μ, σ], t]First-order probability density function:
Plot[Evaluate@Table[PDF[WienerProcess[][t], x], {t, {1 / 2, 1, 2}}], {x, -4, 4}, Filling -> Axis, PlotLegends -> {"t = 1/2", "t = 1", "t = 2"}]PDF[WienerProcess[μ, σ][t], x]Compare with the density function of a normal distribution:
PDF[NormalDistribution[μ t, σ Sqrt[t]], x]Simplify[% - %%]Multivariate slice distributions:
SliceDistribution[WienerProcess[μ, σ], {s, t}]WienerProcess[][{1, 2, 3}]//MeanSecond-order PDF:
PDF[WienerProcess[μ, σ][{s, t}], {x, y}]Higher-order PDF:
PDF[WienerProcess[μ, σ][{1, 3, 7}], {x, y, z}]Compute the expectation of an expression:
Expectation[x[t] ^ 2, xWienerProcess[μ, σ]]Calculate the probability of an event:
Probability[x[t] < 6, xWienerProcess[μ, σ]]Skewness and kurtosis are constant:
Skewness[WienerProcess[μ, σ][t]]Kurtosis[WienerProcess[μ, σ][t]]Moment[WienerProcess[μ, σ][t], r]CharacteristicFunction[WienerProcess[μ, σ][t], w]MomentGeneratingFunction[WienerProcess[μ, σ][t], w]CentralMoment and its generating function:
CentralMoment[WienerProcess[μ, σ][t], r]CentralMomentGeneratingFunction[WienerProcess[μ, σ][t], w]FactorialMoment has no closed form for symbolic order:
FactorialMoment[WienerProcess[μ, σ][t], 3]FactorialMomentGeneratingFunction[WienerProcess[μ, σ][t], w]Cumulant and its generating function:
Cumulant[WienerProcess[μ, σ][t], r]CumulantGeneratingFunction[WienerProcess[μ, σ][t], w]Applications (7)
Define a two-dimensional Bessel process:
Bessel2 = TransformedProcess[Sqrt[x[t]^2 + y[t]^2], {xWienerProcess[], yWienerProcess[]}, t];data = RandomFunction[Bessel2, {0, 10, 0.01}, 3];ListLinePlot[data, PlotRange -> All]{Mean[Bessel2[t]], Variance[Bessel2[t]]}Define a martingale process using a quadratic WienerProcess:
proc = TransformedProcess[w[t] ^ 2 - t, wWienerProcess[], t];Mean[proc[t]]CovarianceFunction[proc, s, t]ListLinePlot[RandomFunction[proc, {0, 2, .01}, 3]]Define the stochastic exponential function:
𝒫 = TransformedProcess[E^w[t] - (t/2), wWienerProcess[], t];SeedRandom[5];
data = RandomFunction[𝒫, {0, 10, 0.01}, 3];ListLinePlot[data, PlotRange -> All]{Mean[𝒫[t]], Variance[𝒫[t]]}The corresponding differential equation is u[t] u[t] w[t]:
𝒫2 = ItoProcess[ⅆu[t] == u[t]ⅆw[t], u[t], {u, 1}, t, wWienerProcess[]];SeedRandom[5];
data = RandomFunction[𝒫2, {0, 10, 0.01}, 3];ListLinePlot[data, PlotRange -> All]{Mean[𝒫2[t]], Variance[𝒫2[t]]}Use WienerProcess directly to simulate GeometricBrownianMotionProcess:
μ = 1;σ = 1 / 3;x0 = 2;proc = WienerProcess[μ - σ^2 / 2, σ];
SeedRandom[3];
data = RandomFunction[proc, {0, 1, s = .01}];Apply a transformation to the random sample:
sample = x0 Exp[data];Compare to the corresponding GeometricBrownianMotionProcess:
SeedRandom[3];
gbm = RandomFunction[GeometricBrownianMotionProcess[μ, σ, x0], {s, 1 + s, s}];ListLinePlot[{sample, gbm}, PlotStyle -> {Thick, Dashed}]Use WienerProcess directly to simulate BrownianBridgeProcess:
μ = 0;σ = 1 / 3;t0 = 0;t1 = 2;x0 = 0;x1 = 0;proc = WienerProcess[μ, σ];
SeedRandom[3];
data = RandomFunction[proc, {t0, t1, .01}];Apply a transformation to the random sample:
sample = TimeSeriesMapThread[x0(x1 - x0)(#1 - t0) / (t1 - t0) + #2 - (#1 - t0) Last[data["Values"]] / (t1 - t0) - (t1 - #1)First[data["Values"]] / (t1 - t0)&, data];Compare to the corresponding BrownianBridgeProcess:
SeedRandom[3];
data = RandomFunction[BrownianBridgeProcess[σ, {t0, x0}, {t1, x1}], {t0, t1, .01}];ListLinePlot[{sample, data}, PlotStyle -> {Thick, Dotted}]Use Wiener process to simulate a solution to the stochastic differential equation
:
P[t_, w_] := p E^σ w + (μ - (σ^2/2)) tUse the simulation to plot the solution:
μ = 2;σ = .1;p = 1;sim = RandomFunction[WienerProcess[], {0, 3, 0.01}, 10 ^ 2];
sol = TimeSeriesMapThread[P[#1, #2]&, sim];paths = ListLinePlot[sol, PlotStyle -> Directive[Opacity[.1]]]Find the mean function of the simulated paths:
meanFunction = TimeSeriesThread[Mean, sol];Show[paths, ListLinePlot[meanFunction, PlotStyle -> Directive[Black, Thick]]]Compare with the corresponding smooth solution:
smoothsol = NDSolve[P'[t] == μ P[t] && P[0] == p, P, {t, 0, 3}]Plot[P[t] /. smoothsol, {t, 0, 3}]Find the distribution of the time a WienerProcess with positive drift takes to reach 2:
sample = Map[FirstCase[#, _ ? (Last[#] ≥ 2&)]&, RandomFunction[WienerProcess[1, 1], {0, 15, 0.01}, 10 ^ 4]["Paths"]];Remove empty lists and extract times:
data0 = DeleteCases[sample, {}][[All, 1]];data = Cases[data0, _ ? Positive];Fit InverseGaussianDistribution to the data:
edist = EstimatedDistribution[data, InverseGaussianDistribution[μ, λ]]Compare its histogram to the PDF:
Show[
Histogram[data, 20, "PDF"],
Plot[PDF[edist, x], {x, 0, 10}, PlotStyle -> Thick]]Properties & Relations (12)
A Wiener process is not weakly stationary:
WeakStationarity[WienerProcess[μ, σ]]Wiener process has independent increments:
proc = WienerProcess[μ, σ];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]//Simplify% === %%Conditional cumulative distribution function:
Table[Plot[Evaluate@Probability[(x[5] <= Subscript[x, 2])(x[2] == Subscript[x, 1]), xWienerProcess[]], {Subscript[x, 2], -4, 6}, Filling -> Axis, PlotLabel -> Row[{"SubscriptBox[x, 1] = ", 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]), xWienerProcess[], Assumptions -> 0 < Subscript[t, 1] < Subscript[t, 2] && 0 ≤ Subscript[x, 1] ≤ Subscript[t, 1] && 0 ≤ Subscript[x, 2] ≤ Subscript[t, 2]]//SimplifyThe correlation function of the Wiener process is the same as that of RandomWalkProcess:
CorrelationFunction[RandomWalkProcess[p], s, t]CorrelationFunction[WienerProcess[μ, σ], s, t]A Wiener process is a special ItoProcess:
ItoProcess[WienerProcess[μ, σ]]As well as StratonovichProcess:
StratonovichProcess[WienerProcess[μ, σ]]Simulate the proportion of time spent on the positive side by a standard WienerProcess:
data[n_] := RandomFunction[WienerProcess[], {0, 1, 1 / n}];ratio[n_] := Count[data[n]["Values"], _ ? Positive] / nIn the limit, the ratio follows ArcSinDistribution:
sample[n_, walks_] := Table[ratio[n], {i, walks}]Show[Histogram[sample[10 ^ 3, 10 ^ 3], 20, "PDF"], Plot[PDF[ArcSinDistribution[{0, 1}], x], {x, 0, 1}, PlotStyle -> Thick]]Find the distribution of the last time WienerProcess changed sign between times 0 and 1:
data = RandomFunction[WienerProcess[], {0, 1, .01}, 10 ^ 4];Calculate the differences of signs to find sign changes:
diff = Differences[Sign[data]];Extract paths and find times of the last sign change for each path:
paths = diff["Paths"];sample = Map[First[FirstCase[Reverse[#], _ ? (Last[#] =!= 0&)]]&, paths];In the limit, the times follow ArcSinDistribution:
Show[Histogram[sample, 20, "PDF"], Plot[PDF[ArcSinDistribution[{0, 1}], x], {x, 0, 1}, PlotStyle -> Thick]]Find the distribution of the time corresponding to the maximum value of WienerProcess until time 1:
data = RandomFunction[WienerProcess[], {0, 1, .01}, n = 10 ^ 4]["Paths"];From each path, extract the times corresponding to the maximum for that path:
sample = {};
Do[
path = data[[i]];
m = Max[path[[All, 2]]];AppendTo[sample, First@FirstCase[path, _ ? (Last[#] == m&)]], {i, n}]In the limit, the times follow ArcSinDistribution:
Show[Histogram[sample, 20, "PDF"], Plot[PDF[ArcSinDistribution
[{0, 1}], x], {x, 0, 1}, PlotStyle -> Thick]]Wiener process is scaling invariant:
proc = TransformedProcess[Sqrt[c]x[t / c], xWienerProcess[], t];Mean[proc[t]]CovarianceFunction[proc, s, t]Compare to the WienerProcess:
Mean[WienerProcess[][t]]CovarianceFunction[WienerProcess[], s, t]Wiener process is invariant under a difference transformation:
proc = TransformedProcess[x[t + u] - x[u], xWienerProcess[], t];Mean[proc[t]]CovarianceFunction[proc, s, t]Compare to the WienerProcess:
Mean[WienerProcess[][t]]CovarianceFunction[WienerProcess[], s, t]GeometricBrownianMotionProcess is a transformation of a WienerProcess:
proc[μ_, σ_, a_] := TransformedProcess[a Exp[(μ - σ^2 / 2)t + σ w[t]], wWienerProcess[], t]ListLinePlot[RandomFunction[proc[0, 1, 3], {0, 1, .001}]]PDF[proc[0, 1, 3][t], x]Compare to the slice distribution of the corresponding GeometricBrownianMotionProcess:
PDF[GeometricBrownianMotionProcess[0, 1, 3][t], x]% - %%//FullSimplifyWiener process is a transformation of BrownianBridgeProcess:
𝒫 = TransformedProcess[(t + 1)x[t / (t + 1)], xBrownianBridgeProcess[], t];Mean[𝒫[t]]CovarianceFunction[𝒫, s, t]sample = RandomFunction[𝒫, {0, 1, .01}];ListLinePlot[sample, Filling -> Axis]Neat Examples (3)
Simulate a Wiener process in two dimensions:
SeedRandom[103];sample = RandomFunction[WienerProcess[], {0, 1, .001}, 2]["ValueList"];ListLinePlot[Transpose@sample, ColorFunction -> "FallColors"]Simulate a Wiener process in three dimensions:
proc = WienerProcess[];
SeedRandom[123];
sample = Table[RandomFunction[proc, {0, 1, 0.01}, 3]["ValueList"], {6}];Graphics3D@Table[{ColorData["SolarColors"][RandomReal[]], Tube@Line@sample[[i]]}, {i, 6}]Simulate 500 paths from a Wiener process:
data = RandomFunction[WienerProcess[], {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 -> 70]&[HistogramList[sd, {Range[Min[sd], Max[sd], (Max[sd] - Min[sd]) / 20]}]];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, 10}], PlotStyle -> (cf /@ Rescale[sd]), BaseStyle -> Directive[Thin, Opacity[0.5]], PlotRangePadding -> {{0, .25}, {.5, .5}}]History
Text
Wolfram Research (2012), WienerProcess, Wolfram Language function, https://reference.wolfram.com/language/ref/WienerProcess.html.
CMS
Wolfram Language. 2012. "WienerProcess." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WienerProcess.html.
APA
Wolfram Language. (2012). WienerProcess. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WienerProcess.html
BibTeX
@misc{reference.wolfram_2026_wienerprocess, author="Wolfram Research", title="{WienerProcess}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/WienerProcess.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_wienerprocess, organization={Wolfram Research}, title={WienerProcess}, year={2012}, url={https://reference.wolfram.com/language/ref/WienerProcess.html}, note=[Accessed: 13-June-2026]}