sas中使用iml可以模拟arma数据,方程为 Yt-φ1Y(t-1)-φ2Y(t-2)=μ+Et-θ1E(t-1)-θ1E(t-2)。拟合一个arma(1,1)模型,代码为
proc iml;
phi={1 -0.8};
theta={1 0.4};
y=armasim(phi,theta,10,1,400,20140418);
create b from y[colname="y"];append from y;
print y;
quit;
模拟的数据符合Yt-0.8Y(t-1)=2+Et+0.4E(t-1)
但是在模拟AR(2)模型的时候就出问题了,
proc iml;
phi={1 -0.8 -0.36};
theta={1};
y=armasim(phi,theta,10,1,400,20140418);
create b from y[colname="y"];append from y;
print y;
quit;
sas日志中提示 ERROR: (execution) Matrix should be non-singular.
我试了一下 phi中最后一个数必须是正数才能跑出来,请问为什么?
我对矩阵一点都不了解,盼高人指教。