# 对期望值的随机过程支持的改进

Mathematica 10 中改进的对随机过程和概率以及统计框架的整合，使对许多过程切片进行符号计算成为可能. 特别是在以下范例中，对两个绝对自相关函数的估计量进行研究，调查估计量的偏差和其总体方差间的权衡.

 In[1]:= Xarma\[ScriptCapitalP] = ARMAProcess[{2/5}, {1/5}, 4/3]; \[ScriptCapitalN] = 25;

 In[2]:= X\!\(\*OverscriptBox[\(\[Gamma]1\), \(^\)]\) = Table[1/\[ScriptCapitalN] \!\( \*UnderoverscriptBox[\(\[Sum]\), \(s = 0\), \(\[ScriptCapitalN] - 1 - h\)]\(x[s]\ x[s + h]\)\), {h, 0, \[ScriptCapitalN] - 1}];
 In[3]:= X\!\(\*OverscriptBox[\(\[Gamma]2\), \(^\)]\) = Table[1/(\[ScriptCapitalN] - h) \!\( \*UnderoverscriptBox[\(\[Sum]\), \(s = 0\), \(\[ScriptCapitalN] - 1 - h\)]\(x[s]\ x[s + h]\)\), {h, 0, \[ScriptCapitalN] - 1}];

 In[4]:= Xest1mean = Expectation[ \!\(\*OverscriptBox[\(\[Gamma]1\), \(^\)]\), x \[Distributed] arma\[ScriptCapitalP]];
 In[5]:= Xest2mean = Expectation[ \!\(\*OverscriptBox[\(\[Gamma]2\), \(^\)]\), x \[Distributed] arma\[ScriptCapitalP]];

 In[6]:= Xest1mean == AbsoluteCorrelationFunction[ arma\[ScriptCapitalP], {\[ScriptCapitalN] - 1}]["Values"]
 Out[6]=
 In[7]:= Xest2mean == AbsoluteCorrelationFunction[ arma\[ScriptCapitalP], {\[ScriptCapitalN] - 1}]["Values"]
 Out[7]=

 In[8]:= XAbsoluteTiming[est1var = Expectation[( \!\(\*OverscriptBox[\(\[Gamma]1\), \(^\)]\) - est1mean)^2, x \[Distributed] arma\[ScriptCapitalP]];]
 Out[8]=
 In[9]:= XAbsoluteTiming[est2var = Expectation[( \!\(\*OverscriptBox[\(\[Gamma]2\), \(^\)]\) - est2mean)^2, x \[Distributed] arma\[ScriptCapitalP]];]
 Out[9]=

 In[10]:= XListPlot[{est1var, est2var}, PlotLegends -> {"Biased", "Unbiased"}]
 Out[10]=

 In[11]:= XAbsoluteCorrelationFunction[ Table[x[s], {s, 0, \[ScriptCapitalN] - 1}], {\[ScriptCapitalN] - 1}] == \!\(\*OverscriptBox[\(\[Gamma]1\), \(^\)]\)
 Out[11]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »