ariman911 发表于 2013-5-3 19:03 
你的信賴區間要如何估計?
要用標準差還是迴歸估計?
首先感谢您给我回复!我做的是时间序列数据,建立了一个MA(1)模型,然后在模型的基础上我
forecast lead=5 id=time out=results;
run;
就预测了后5期的预测值了,也给出了95%的置信区间。
我的具体程序如下:
模型绘制时序图、平稳性与随机性检验 、识别
data example;
input status@@;
difx=dif(status);
time=_n_;
cards;
0.97 0.45 1.61 1.26 1.37 1.43 1.32 1.23 0.84 0.89 1.18 1.33 1.21 0.98 0.91 0.61 1.23 0.97 1.10 0.74 0.80 0.81 0.80 0.60 0.59 0.63 0.87 0.36 0.81 0.91 0.77 0.96 0.93 0.95 0.65 0.98 0.70 0.86 1.32 0.88 0.68 0.78 1.25 0.79 1.19 0.69 0.92 0.86 0.86 0.85 0.90 0.54 0.32 1.40 1.14 0.69 0.91 0.68 0.57 0.94 0.35 0.39 0.45 0.99 0.84 0.62 0.85 0.73 0.66 0.76 0.63 0.32 0.17 0.46
;
proc gplot;
plot status*time difx*time;
symbol v=star c=blue i=join;
run;
proc arima;
identify var=status(1,0) minic p=(0:10)q=(0:5);
run;
模型的参数估计
estimate q=1;
run;
estimate q=1 noint;
run;
模型序列的预测
forecast lead=5 id=time out=results;
run;
模型序列的预测图
proc gplot data=results;
plot status*time=1 forecast*time=2 l95*time=3 u95*time=3/overlay;
symbol1 c=black I=none v=star;
symbol2 c=red I=join v=none;
symbol3 c=green I=join v=none l=32;
run;
就是我想得到后面每个数据的预测值的置信区间,虽然实际上呢我也知道这些数据的实际值。你看我给你的程序上已经有了74个数据了,假如说我想利用前70个预测第71个,这个我会。利用前71个预测第72个我也会。这样一个一个很麻烦,因为我的数据太多。有没有可能就是用个循环语句,就是系统会自己每次会往后读取一个数据,然后就能每读取一个就能预测一个。