1、非平稳序列的确定性分析非平稳序列的确定性分析1、 首先画出时序图如下:从时序图可以看出这显然是一个非平稳序列,而其又呈现出指数增长趋势,因此考虑拟合非线性模型: 利用sas计算得到拟合模型为:拟合图如下:检验: Sum of Mean Approx Source DF Squares Square F Value Pr F Model 2 1.26E11 6.3E10 1778.88 ChiSq -Autocorrelations-6 57.36 6 .0001 0.779 0.437 0.009 -0.370 -0.574 -0.63712 72.31 12 |t|Intercept 1 1
2、02481 1353 75.76 .0001t 1 -102.3357 11.6710 -8.77 .0001对趋势项trend拟合的线性回归模型为:以1994年9月到1995年8月季节指数作为1995年9月到1996年8月季节指数进行预测如下: Obs t SEASON trend px 1 1960 99.468 83139.55 82697.63 2 1960 107.126 83037.22 88954.68 3 1960 89.677 82934.88 74373.21 4 1960 95.666 82832.55 79242.33 5 1960 107.444 82730.21 8
3、8888.74 6 1960 90.898 82627.87 75107.18 7 1960 99.453 82525.54 82074.44 8 1960 97.194 82423.20 80110.21 9 1960 105.646 82320.87 86968.96 10 1960 104.305 82218.53 85757.87 11 1960 99.508 82116.20 81712.47 12 1960 103.307 82013.86 84726.13本题代码:data a; input x; t=intnx(month,1jan1980d,_n_-1); format t
4、year4.;cards;76378 71947 33873 96428 105084 95741 110647 100331 94133 10305590595 101457 76889 81291 91643 96228 102736 100264 103491 9702795240 91680 101259 109564 76892 85773 95210 93771 98202 97906100306 94089 102680 77919 93561 117062 81225 88357 106175 91922104114 109959 97880 105386 96479 9758
5、0 109490 110191 90974 98981107188 94177 115097 113696 114532 120110 93607 110925 103312 120184103069 103351 111331 106161 111590 99447 101987 85333 86970 10056176378 71947 33873 96428 105084 95741 110647 100331 94133 10305590595 101457 76889 81291 91643 96228 102736 100264 103491 9702795240 91680 10
6、1259 109564 76892 85773 95210 93771 98202 97906100306 94089 102680 77919 93561 117062 81225 88357 106175 91922104114 109959 97880 105386 96479 97580 109490 110191 90974 98981107188 94177 115097 113696 114532 120110 93607 110925 103312 120184103069 103351 111331 106161 111590 99447 101987 85333 86970
7、 10056189543 89265 82719 79498 74846 73819 77029 78446 86978 7587869571 75722 64182 77357 63292 59380 78332 72381 55971 6975085472 70133 79125 85805 81778 86852 69069 79556 88174 6669872258 73445 76131 86082 75443 73969 78139 78646 66269 7377680034 70694 81823 75640 75540 82229 75345 77034 ;proc x11
8、 data=a; monthly date=t; var x; output out=out b1=x d10=season d11=adjusted d12=trend d13=irr;data b;set out;t=_n_;run;proc print data=b;proc autoreg data=b;model trend=t;run;data bb;set out;keep t season;if 01sep1994d=t |t| Intercept 1 1015.52220 26.82663 37.86 .0001 t 1 20.93178 0.48026 43.58 .000
9、1该线性趋势模型为:接下来生成随机波动序列进行向前一年预测:Obs index pt px time1 0.98215 3045.93 2991.57 20012 0.94309 3066.86 2892.33 20013 0.91987 3087.79 2840.36 20014 0.91084 3108.72 2831.54 20015 0.92541 3129.65 2896.22 20016 0.95145 3150.59 2997.63 20017 0.92908 3171.52 2946.58 20018 0.93965 3192.45 2999.77 20019 1.00950
10、3213.38 3243.90 200110 1.05372 3234.31 3408.06 200111 1.10046 3255.25 3582.26 200112 1.33479 3276.18 4373.01 2001最后绘制序列实际值和预测值的拟合图如下:本题代码:data bin1;do year=1993 to 2000; do month=1 to 12; input milk ; output; end;end;cards;977.5 892.5 942.3 941.3 962.2 1005.7 963.8 959.8 1023.3 1051.1 1102 1415.5119
11、2.2 1162.7 1167.5 1170.4 1213.7 1281.1 1251.5 1286 1396.2 1444.1 1553.8 1932.21602.2 1491.5 1533.3 1548.7 1585.4 1639.7 1623.6 1637.1 1756 1818 1935.2 2389.51909.1 1911.2 1860.1 1854.8 1898.3 1966 1888.7 1916.4 2083.5 2148.3 2290.1 2848.62288.5 2213.5 2130.9 2100.5 2108.2 2164.7 2102.5 2104.4 2239.6
12、 2348 2454.9 2881.72549.5 2306.4 2279.7 2252.7 2265.2 2326 2286.1 2314.6 2443.1 2536 2652.2 3131.42662.1 2538.4 2403.1 2356.8 2364 2428.8 2380.3 2410.9 2604.3 2743.9 2781.5 3405.72774.7 2805 2627 2572 2637 2645 2597 2636 2854 3029 3108 3680;data bin1;set bin1;time=intnx(month,1jan1993d ,_n_-1);forma
13、t time year4.;proc print;proc gplot data=bin1;plot milk*time/haxis=1jan1993d to 1jan2000d by year;symbol c=blue i=join v=none;run;proc sql;select avg(milk)from bin1;run;proc sql;create table bin2 (month num, index num);insert into bin2 select month, avg(milk)/ 2030.7135 as indexfrom bin1group by mon
14、th;quit;run;proc print data=bin2;run;proc gplot data=bin2;plot index*month/vaxis=0.9 to 1.35 by 0.05;symbol c=blue i=join v=square;run;proc sort data=bin1 out=bin3;by month year;data bin4;merge bin2 bin3 ;by month;admilk=milk/index;proc print;run;proc sort data=bin4 out=bin5;by year month;proc gplot
15、 data=bin5;plot admilk*time/haxis=1jan1993d to 1jan2000d by year ;symbol c=blue i=none v=circle ;run;data bin5;set bin5;t=_n_;proc reg;model admilk=t ;output p=pmilk out=trend;proc gplot;plot pmilk*t=1 admilk*t=2/overlay;symbol1 i=join c=green v=none;symbol2 i=none c=blue v=circle;run;data bin6;set trend;noise=admilk-pmilk;keep noise m;proc gplot data=bin6;plot noise*m;symbol i=none c=blue v=circl
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1