# 作为离散向量 Ornstein–Uhlenbeck 过程的向量自回归过程

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

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

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

 In[7]:= Xdt = 1/1000;
 In[8]:= 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}];

 In[9]:= X{sol} = NSolve[ Join[meanEqs, Flatten[covEqs]], {c1, c2, x10ar, x20ar, a11, a12, a21, a22, s1, s2, s12}]
 Out[9]=

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

 Out[11]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »