# Identify Regularly Sampled Ornstein–Uhlenbeck Process as an Autoregressive Process

Mathematica 10's improved support of computation with process slices allows you to straightfowardly use method of moments for multivariate process slices to establish equivalence in law between two processes.

Both autoregressive (AR) process and the OrnsteinUhlenbeck (OU) process are Gaussian processes, determined by their mean and covariance functions.

 In:= Xar\[ScriptCapitalP] = ARProcess[c, {a1}, si2]; ou\[ScriptCapitalP] = OrnsteinUhlenbeckProcess[mu, si, th];

Use method of moments for slice distributions to match parameters of the stationary AR process to the restriction of the stationary OU process to a regular time grid.

 In:= XarSlice\[ScriptCapitalD] = ar\[ScriptCapitalP][{0, 1, 2, 3, 4}]; ouSlice\[ScriptCapitalD] = ou\[ScriptCapitalP][{dt, 2 dt, 3 dt, 4 dt, 5 dt}];
 In:= X{sol1} = (Solve[{Mean[arSlice\[ScriptCapitalD]] == Mean[ouSlice\[ScriptCapitalD]], Covariance[arSlice\[ScriptCapitalD]] == Covariance[ouSlice\[ScriptCapitalD]]}, {c, a1, si2}] // FullSimplify)
 Out= Confirm that covariance functions agree for symbolic lag.

 In:= XSimplify[CovarianceFunction[ar\[ScriptCapitalP] /. sol1, h], dt > 0 && th > 0 && h \[Element] Integers]
 Out= In:= XCovarianceFunction[ou\[ScriptCapitalP], h dt]
 Out= Repeat the exercise for AR and OU processes with initial conditions.

 In:= Xar\[ScriptCapitalP]2 = ARProcess[c, {a1}, si2, {x0ar}]; ou\[ScriptCapitalP]2 = OrnsteinUhlenbeckProcess[mu, si, th, x0];
 In:= XarSlice\[ScriptCapitalD]2 = ar\[ScriptCapitalP]2[{0, 1, 2, 3, 4}]; ouSlice\[ScriptCapitalD]2 = ou\[ScriptCapitalP]2[{dt, 2 dt, 3 dt, 4 dt, 5 dt}];
 In:= X{sol2} = (Solve[{Mean[arSlice\[ScriptCapitalD]2] == Mean[ouSlice\[ScriptCapitalD]2], Covariance[arSlice\[ScriptCapitalD]2] == Covariance[ouSlice\[ScriptCapitalD]2]}, {c, a1, si2, x0ar}] // FullSimplify)
 Out= Use the autoregressive representation to sample OrnsteinUhlenbeck process on a regular time grid.

 In:= XRandomFunction[ ar\[ScriptCapitalP]2 /. sol2 /. {mu -> 1, si -> 2, th -> 2/3, x0 -> 10, dt -> 0.01}, {0, 200}, 5] // ListPlot[#, ImageSize -> 400] &
 Out= ## Mathematica

Questions? Comments? Contact a Wolfram expert »