(*the model y[t]=a1*y[t-1]+a2*y[t-2]+r+m1*e[t-1]+m2*e[t-2] *) f[{y1_,y2_,e1_,e2_}]:=Block[{e}, e=RandomReal[NormalDistribution[0,sigma]]; {ar1*y1+ar2*y2+e+ma1*e1+ma2*e2,y1,e,e1} ]; (* parameters *) {ar1,ar2,ma1,ma2,sigma}={1.6,-0.7,-1.8,0,2}; ListLinePlot[NestList[f,{0.9,0.5,0.1,0},100][[All,1]], PlotStyle->Thickness[0.005],Frame->True]
Mathematica 教學 模擬ARMA(2,2)
由 戴忠淵 於 2012年11月3日星期六
下午12:54 發表
讀者回應 ( 0 意見 )
訂閱發佈留言 (Atom)
發佈留言
Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.
如果這篇文章對你有幫助,那請留個訊息給我~