|
|
板凳

楼主 |
发表于 2009-3-15 13:23:50
|
只看该作者
Re: 各位英雄,帮帮忙吧~~~
thanks for your advice,and my code is here,and my personal opinion of the model is qutie well,because the result of the forecast compared with the real figure seems suitable:
data zlh;
input cpi@@;
date=intnx('month','1jan98'd,_n_-1);
format date monyy.;
cards;
100.3 99.9 100.7 99.7 99 98.7 98.6 98.6 98.5 98.9 98.8 99
98.8 98.7 98.2 97.8 97.8 97.9 98.6 98.7 99.2 99.4 99.1 99
99.8 100.7 99.8 99.7 100.1 100.5 100.5 100.3 100 100 101.3 101.5
101.2 100 100.8 101.6 101.7 101.4 101.5 101 99.9 100.2 99.7 99.7
99 100 99.2 98.7 98.9 99.2 99.1 99.3 99.3 99.2 99.3 99.6
100.4 100.2 100.9 101 100.7 100.3 100.5 100.9 101.1 101.8 103 103.2
103.2 102.1 103 103.8 104.4 105 105.3 105.3 105.2 104.3 102.8 102.4
101.9 103.9 102.7 101.8 101.8 101.6 101.8 101.3 100.9 101.2 101.3 101.6
101.9 100.9 100.8 101.2 101.4 101.5 101 101.3 101.5 101.4 101.9 102.8
102.2 102.7 103.3 103 103.4 104.4 105.6 106.5 106.2 106.5 106.9 106.5
107.1 108.7 108.3 108.5 107.7 107.1 106.3 104.9 104.6 104 102.4
;
run;
proc gplot data=Zlh;
symbol1 i=join v=dot c=red;
plot cpi*date=1;
run;
data cpi;
set zlh;
difcpi=dif(cpi);
proc gplot;
plot cpi*date difcpi*date;
symbol v=star c=black i=join;
run;
proc arima;
identify var=cpi(1) nlag=24;
estimate p=(1)q=(1)(12) noint ;
forecast lead=12 interval=month id=date out=b;
run;
data cpi;
set b;
proc gplot data=cpi;
symbol1 I=join v=star r=1 c=red;
symbol2 I=join v=plus r=1 c=green;
proc gplot data=cpi;
where date>='1jan98'd;
plot cpi*date=1 forecast*date=2/
overlay haxis='1jan98'd to '1jan10'd by year;
run; |
|