# Vector Autoregressive Process as Discretized Vector Ornstein–Uhlenbeck Process

Improved support for computation with process slices, as well as support for arbitrary mean time series processes and time processes with initial values, allows the matching of a uniformly discretized Gaussian Ito process to a vector-valued autoregressive process.

Define a 2D Ito process with linear drift coefficients and constant diffusion coefficients.

 In:= XitoPr = ItoProcess[{{1 - (5 x1[t] + 3 x2[t])/ 4, -1 - (3 x1[t] + 5 x2[t])/4}, {{1, 0}, {Sqrt, 1}}, {x1[t], x2[t]}}, {{x1, x2}, {0, 1/2}}, {t, 0}];

Define a bivariate autoregressive process with initial values.

 In:= XvarPr = ARProcess[{c1, c2}, {{{a11, a12}, {a21, a22}}}, {{s1, s12}, {s12, s2}}, {{x10ar, x20ar}}];

Since both processes are Gaussian, they are completely specified by their mean and covariance functions.

 In:= XitoPrmf[t_] = Mean[itoPr[t]];
 In:= XitoPrcovF[s_, t_] = Simplify[CovarianceFunction[itoPr, s, t]];
 In:= XvarPrmf[n_] = Mean[varPr[n]];
 In:= XvarPrcovF[n_, m_] = Simplify[CovarianceFunction[varPr, n, m]];

Construct equations of moments by equating the Ito process moment functions at regularly spaced times and the VAR moment functions at consecutive integers.

 In:= Xdt = 1/1000;
 In:= XmeanEqs = Table[itoPrmf[n dt] == varPrmf[n - 1], {n, 4}]; covEqs = Table[ Flatten[itoPrcovF[n dt, m dt]] == Flatten[varPrcovF[n - 1, m - 1]], {n, 4}, {m, n, 4}];

Solve the equations.

 In:= X{sol} = NSolve[ Join[meanEqs, Flatten[covEqs]], {c1, c2, x10ar, x20ar, a11, a12, a21, a22, s1, s2, s12}]
 Out= Simulation of the VAR process gives exact simulation of the Ito process of the regular grid.

 In:= Xpath = RandomFunction[varPr /. sol, {0, 20000}]
 Out= Visualize the path.

 Out= ## Mathematica

Questions? Comments? Contact a Wolfram expert »