|
|
楼主

楼主 |
发表于 2007-11-5 22:32:29
|
只看该作者
[求助]关于ARIMA模型中forecasting with input variables
以下是我自己改进的一段程序,
AO and LS 在下面的程序中是input series , 按照SAS HELP中说的如果没有给定 input series 模型,那么在forecast 期间的需要用到input series 值就取 last actual value。我的理解有错吗?如果没错,下面程序为什么不能得到预测值。但若我在原始的data set 中加入若干缺失值时,就能得到预测值。
请各位高手指点一下!
data b_j_seriesj;
input x y @@;
label x = 'Input Gas Rate'
y = 'Output CO2';
t=_n_;
cards;
(具体数据不写了)
;
/* model with input series*/
proc arima data=b_j_seriesj;
identify var=y nlag=10 stationarity=(adf);
identify var=x nlag=10 stationarity=(adf);
estimate p=3;
identify var=y crosscorr=(x) nlag=10 ;
estimate input=(3$ (1,2)/(1) x) plot ;
identify var=y crosscorr=(x) nlag=10 noprint;
estimate p=2 input=(3$ (1,2)/(1) x) plot;
outlier;
data b_j_seriesj1;
set b_j_seriesj;
if _n_=264 then AO=1;
else AO=0;
if _n_>=199 then LS=1;
else LS=0;
proc arima data=b_j_seriesj1;
identify var=x noprint;
estimate p=3 noprint;
identify var=y crosscorr=(x AO LS) noprint;
estimate p=2 input=(3$ (1,2)/(1) x AO LS) plot;
forecast lead=10 id=t out=out;
proc gplot data=out;
plot y*t=1 forecast*t=2 /overlay;
symbol1 c=black i=none v=star;
symbol2 c=red i=join v=none;
run; |
|