时间序列整合分析(二)_第1页
时间序列整合分析(二)_第2页
时间序列整合分析(二)_第3页
时间序列整合分析(二)_第4页
时间序列整合分析(二)_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、22.ariam模型:即不平稳序列进行差分后,在建立arma模型。 例:对我国2000-2007年社会消费品零售总额进行建模和预报。(1) 先做出时序图:data ex;input x ;y=dif12(x);t=intnx(1 month t r 101jan2000,d,_n_-l) ;format t monyy.; cards;2962.92804.92626.62571.52636.92645.22596.92636.33136.93347.33107.83680.03332.83047.12876.12820.92929.62908.72851.42889.42854 33029.

2、33421.74033.33324.43596.13114.83052.23202.13158.83096.63143.73422.436619373314404.43907.43706.43494.83406 93463.33576.93562.13609.63971.84204.44202.74735.74569.44211.44049.84001.84166.14250.74209.24262.74717.74983.24965.65562.55300.95012.24799.14663.34899.24935.0493495040.85495.25846 65909.06850.466

3、41.6600195796.75774.6617566057.86012.26077.46553.66997.76821.77499.27488.37013.76685.86672.57157.597026.06998.27116.67668.48263.08104.79015.3procgplotplotx*t;symboli=jionv=dot;run;(2) 观察时序图,易知该序列具有显著的趋势性和季节性,显然是非平稳序列。 为了进一步确定其非平稳性,作出该序列的白相关图:autocorrelat ionsstd error025888741.00000<pfpqifprpqbf(

4、bfprpft>rprp«jbrprpf|bfpft>f|bfp124219480.93552il* ill alt all il* til lit ill al* ill ill hi ala ill hi ill ill alt lie t1 u1 u1 <p u1u1 !*h1u1222910840.88497山山山山山山山aa山山山出山aw山山 i 11 | «| 1 j 1 | 11 1 |i | i i | 11 | 321474730.82950420271850.78304519417720.75004ipip1|»ip qi i

5、p618641330.72006ipfpqifprpqbfjbfptfprjifpcprjbfp718046130.69706al* ill ill alt il* ell ill ill hi iib ill ha all ill817425440.67309山山山山山山山山出山山出山ip917235470.665751017113750.661055k 卯孤师血恥尬小.1116767850.64769 gi1216269280.62843cpfpqbfprpqbfjbfpqlftbrprpfjb.covariancecorreiat ion-198765432101234567891&qu

6、ot; marks two standard errors00.1020620.1692630.2120520.2435180.2684680.2894740.3075660.3236040.3378730.3512720.3640000.375813自相关图表现出非常缓慢的衰减,表明我国200-2007年社会消费品零售额是不平稳的。(3) 为消除序列的季节性和趋势性,我们进行一阶12步差分。data ex;input x ;difl=dif(x);difl_12=dif12(difl);t=intnx(1 month f z 101jan20001d,_n_-l);format t mony

7、y.;cards;proc gplot;plot dif1_12*t;symbol i=jion v=dot;proc arima;identify var=x(1 12) nlag=12;run;7006005004003002001000-100200300400600600jauoo myoo sepoo jam31 w4y01 sepo1 jamj2 nwy02 sep02 jan03 my09 sepo3 jaw34 htty04 sep04 jam35 my05 sepos jau06 wy06 sep08 jaw7 htty07 sep0? jam38autocorrelatio

8、nslagcovarianeecorrelat ion-1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1std error032395.7601.00000 ill li ili ill ii> alt ala 山 ill ill ill ill 山 ill ill il»01-8174.304-.25233tlitii f|l tp0.1097642-10350.270-.31949if 11 <|b p )! <|»0.11654337367.7680.22743w山a山 ii|t|ii|i0.1266574-47.4

9、62887-.001470.1314855-3973.015-.12264 水窗07980.06003* :0.1328577761.5670.023510.1331838-1592.752-.04917:*0.1332339-1478.357-.04583. *0.133452106227.9190.19224榊脚.0.13363911-859.060-.02652. *0.13693112-11212.539-.34611qj i it a 1* ill ih ill0.136993marks two standard errorspart i a i autoc

10、orreii onslag correlation -1987654321012345678911-0.25233ei> ii> ii>tit2-0.40922x*山*jl>( t i i i 1 i 30.013564-0.06112 *56-0.05600 -0.02132 *7-0.017368-0.020959-0.08676:細100.16597110.06698* 12-0.27721eitit1t|ii|if|l观察vv12xz序列的时序图可知差分运算后的序列基本平稳,利用sas绘制vv12xz序列的自相关函数图和偏自相关函数图均是拖尾的,因此我们对vv1

11、2xz建立arma(p,q)模型。(4) 模型的建立:data ex;input x;difl=dif(x);difl_12=dif12(difl);t=intnx(* month1r ' 01jan2000'df_n_-l);format t monyy.; cards;9proc gplot;p_ot dif l_12*t; symbol i=jion v=dot;proc arima;identify var=x(1 12) nlag=12 minic p= (0:5) q=(0:5);run;lagsmini mum inf ormat i on criterionma

12、 0ma 1ma 2ma 3ma 4ma 5ar 010.079119.9777869.9740879.8291239.8380849.890393ar 19.99472410.025249.9802269.8799319.8913069.94362ar 29.845389.8977369.9280649.8717569.8557799.865479ar 39.7814159.8345759.8811099.9248229.8652729.901188ar 49.7838169.8367779.7767879.8287449.86539.906636ar 59.8334989.8866889.

13、826869.8793969.9089179.94352error series modei:ar(10)mini mum table value: bic(4,2) = 9.776787得到模型的bic值,从图中可以看出,p=4 q=2时,bic(4,2)=9.776787最小,因此选择 arma(4,2)o(5) 对模型arma(4,2)进行参数估计和显著性检验。利用程序:data ex;input x;difl=dif(x);difl_12=dif12(difl);t=intnx('month *, 101jan2000,d,_n_-l) ;format t monyy.;car

14、ds;proc gplot;p1ot difl_12*t;symbol i=jion v=dot; proc arima;identify var=x(1 12) nlag=12;estimate p=4 q=2 method=cls;run;bonditionaileast squares tstimationlag12 12 3 4 u 朗a1r1r1r1r1 mmm a a a a10.4889320.404970.510.6087-0.643670.36677-1.750.08330.356330.286461.240.2174-1.109300.38025-2.920.0046-0.

15、201400.50468-0.400.69100.489360.338581.450.15250.550880.190702.890.0051est im&standard errort valueapproxpr > itl0 12 12 3 4ar 1,3的p值远远大于0.05,所以,可以看出,其中有的参数没有通过检验,ma1.2 ar1,2应将p调整为p=(l,4) q=l,利用程序,进行检验:data ex;input x 0;difl=dif(x);difl_12=dif12(dif1);t=intnx(1 month 1, 101jan20001dz_n_-l);fo

16、rmat t monyy.;cards;proc gplot;plot dif1_12*t;symbol i=jion v=dot; proc arima;identify var=x(1 12) nlag=12;estimate p= (1,4) q=l method=cls;run;condit ional least squares estimationparameterest i matestandard errort valueapproxpr > itllagmu11.611853.970262.920.00450ma1,10-898690.0835910.75<.00

17、011ar1j0.446580.143273.120.00251are 20.029630.129490.230.81964可以看出,仍然有些参数没有通过检验ari,2的p值远远大于0.05接着进行调整,将p调整为 p=l,将q调整为q=l,利用程序,接着进行参数检验:data ex;input x ;difl=dif(x);difl_12=dif12(difl);t=intnx(1 month '.l01jan2000ld,_n_-l); format t monyy.;cards;proc gplot;plot difl_12*t;symbol i=jion v=dot;proc

18、arima;identify var=x(1 12) nlag=12;estimmte p=l q=l method=cls;run;mumaarest i m&testandard errort valueapproxpr > itllag11.590904.059072.860.005500.886380.0742811.93<.000110.438250.142203.080.00281cond i t i onaileast squares estimationrh图中可以看出,所有的参数都通过了检验,iyt=wv2xt9则该模型为表达式为:x =0.43825/.

19、 +q +0.88638.(6)对模型乙=043825儿+£+0.88638殆进行参差检验:(仍时有上个程序得到的结杲)autocorrelation check of residualschi-square df628 412 0 24 26 2 7 3 7 42 2 30.11560.009-0.1300.2390.048-0.0720.0500.01000.014-0.059-0.0590.107-0.104-0.3610.03530.0670.0100.1520.0840.0740.0420.04660.1050.1020.011-0.0570.181-0.008pr >

20、; chisqautocorrelat ions可以看出,残差序列是白噪声序列,所以模型是适应的。(7) 进行预测:data ex;input x ;difl=dif(x);difl_12=dif12(difl);t = intnx(1 month 1'01jan20001d,_n_-l);format t monyy;cards;proc arima;identify var=x(1 12) nlag=12 minic p= (0 5) q=(0 5); estimate p=l q=l method=cls;forecast lead=5 id=t out=results;proc

21、 gplot data=results;plot x*t=l forecast*t=2 195*t=3/overlay;symboll c=blue i=jion v=star;symbol2 c=red i=jion v=none 1=1 w=l; symbol3 c=green i=jion v=none 1=2w=2;ruforecasts for variable xobsforecaststd error95囂 conf i dence limits978850.5542165.11448526.93609174.1725988315.0424188.58947945.4139868

22、4.6708997966.9589197.51217579.84238354.07551007951.3246202.45947554.511583488128206.04198037.97808845.6476由以上两图屮,可以看出,模梨建立的比较成功,提取信息比较充分。23交互函数分析和传递模型:销售量yt和先导经济函数xt如下表,建立传递模型对销售量yt进行分析预测。(1) 根据以下程序:data ex;input x y 0;t=_n_;cards;proc arima;identify var=y (1) crosscor= (x (1) nlag=10;r

23、un;crosscorrelat i onscovariancecorrelation -1987654321012345678910987654321012345678901 . - 一 . 一 一. 10.0020045 -0.025936 0.0317250.00438 -.05667 0.06932 * :0.00550740.01203-0.04052508855.*#0.0182070.03978* :-0.0097765-.021360.0297490.06500* :-0.025165-.05499:*0.0477430.10432*.-0.012176-.02661:*0.0

24、335110.07322* :-0.169802-.371021*!tital*alaal*alft > ( ( 9j9 ( ( )0.3214980.70248 !人 *11!1»£ 人 *11 1 | | | | | | | | | | | | 1 0.0526270.114990.0521290.113900.0177790.03885* .0.0604160.132010.0277880.06072* 0.0303030.06621* 0.00161380.00353marks two standard errors从图屮可以看出,vx对的影响滞后两期。(2)

25、识别xt和yt的适应性模型,并对他们预白噪声化。n01:做出xt的自相关函数,并进行白噪声检验。data ex;input x y ;t=_n_;cards;proc arima;identify var=x;run;3307856714181 2name of variabiemean of work i nc ser i es st orndoi rd dev i at i on number of observetionwi 0123456789012345678801234 a 111111111122222 lcova r i ance14684431 399566 1 371134

26、 1.3395381.306577 1 268269 1 2385801 201308 1 1 70710 1 1212361 079732 1 0545631 014830 0987321 0958522 0329546 0897181 0866626 083038 1 0812523 0786461 0753314 0728836 0700193 0671081corre i at i on100000 0.95310 093373 091222 088977 086368 084346 081849 079725 076355 073529 0.71815 063109 067277 0

27、65275 063301 061097 068942 066548 055333 053557 051300 049633 047683 045700auitocorre i at i onsh<h<h<h<h< h<9kh<h<h<h<h<h<h<<¥<v» ¥<>1 <t> ¥ »t>¥ <v*»» <yi »yi¥ <v> ¥ ¥

28、; <v> <v><v> rjl<v> ¥ <r> ¥ <t> *v> ¥t:+:+: 水水 卡;专;+:水水水水水:*:水水水水水水水水水:t:水.水水水.marks two standard errorsstd error0.081650 0. 137035 0.174365 0203712 0.228154 0.248999 0.267369 0.283581 0.298149 0.310913 0.322297 0.332794 0.342228 0.350934 0.35833

29、7 0.366304 0.373036 0.379194 0.384775 0.380044 0.334316 0.399334 0.403425 0407165autocorrelation check for white noisetolagchi-squaredfpr > chisq口uiocorreiations6755.956<.00010.9530.9340.9120.8900.8640.843121310.6512<.00010.8180.7970.7640.7350.7180.691181703.3918<.00010.6730.6530.6330.61

30、10.5890.565241975.9924<.00010.5530.5360.5130.4960.4770.457可见xt不平稳,我们对其进行一阶差分,令得到乙的口相关函数和口噪声检验。data ex;input x y z_x=dif(x);t=_n_; cards;proc arima;identify var=z_x;run;忖ame of variable = z_x0.0227520.3151621490123456789012345678901234111111111122222covar i ancecorre 1 at i on-1 9 8 7 e;5 4 3 21 0

31、 1 2 3 4 56 7 8 9 1std error0.0993271.00000 1> of q?(x? oft *t*t *t! !*1»1 #t0-0.044402-.44703a*alt ellelt alaile0.0819230.00848310.085410.096921-0.0069778-.07025*0.0974250.0128690.129560.097764-0.0090300-.090910.0989100.00771010.07762* 0.099469-0.0077688-.078210.0998750.0119130.1 19940.1002

32、85-0.0051837-.05219*0.101243-0.012395-.124790.1014240.0185690.186950.102449-0.0085629-.086210.1047140.00403510.04062* 0.105189-0.0037875-.03813*0.105294-0.0017806-.017930.105387-0.0001773-.001790.1054070.00508490.05119* 0.105407-0.0093822-.09446*0.1055740.00194000.019530.1061400.0116360.11715* 0.106

33、164-0.0076348-.07686*h<0.1070280.00219280.022080.1073980.00121270.012210.107428-0.0040950-.04123出0.107438af»marks twostandarderrorsaut ocor厂ei at i onsmean of work i ng series standard dev i at i on number of observationspart i a i autocorre i at i onscorre i at i on7890123456789012341111111

34、11122222-0.022060.084840.05865* -0.169230.08649he*.0.006960.03152*0.01463-0.07827*冰冰-0.03528 *0.01350-0.03684 *-0.08471來來0.119910.07250* 0016890.06338h< .-0.06904:*-198765432101234567891autocorrelation check for white noisetolagchi-squaredfpr > chisqhuluuut r c 1 oil i 5 心637.10<.0001-0.447

35、0.085-0.0700.130-0.0910.0781250.2412<.0001-0.0780-120-0.052-0.1250.187-0.0861852.7918<.00010.041-0.038-0.018-0.0020.051-0.094 -0.0412456.71240.00020.0200.117-0.0770.0220.012从图中可以看出,序列乙不具冇季节性,其自相关函数和偏自相关函数拖尾并迅速衰减于0,而ii样本均值接近于0,所以试探性的令:(1一%忆严=(1一窣)孝),我们用程序将0丁和即)估计出来。data ex;input x ycards;proc a

36、rima;identi£y var=x;estimate p=l q=l noconstant printall plot;run;cond itii least squares estimationparameterest i maitestandard errort vaiueapproxpr > |t|lagmai , 10.055420.082530.670.50301ar1 , 11.000000.0057622173.55<.00011var i ance iest i maite0.77563std errorest i mate0.880699aic389

37、.5562sbc395.5775number ofres i duais150* aic and sbc donot i nciude1og determ i nant.倉utocorrelation check of residualstochi-.agsquaredfpr > chisqautocorre i at ions628 4 0112 33 13 4 54 7768112 3 44 0 8 2 81 1 220.83970.0050.031-0.0530.064-0.0230.0290.9981-0.011-0.001-0.0020.0230.0300.0140.99990

38、.034-0.044-0.020-0.0060.0340.0371.0000-0.0250.0340.038-0.0210.0060.0371.0000-0.0570.0280.0440.0110.017-0.014从图中可以看出,z:x)的适应性模型为其参数叶)=1 &f)=005542,残 差序列/为白噪声序列即有:件左藹竽,记口斫百烏亦n02:考虑yt,做出自相关函数,并进行白噪声检验。 data ex; input x y ; t=_n_;cards;proc arima;identify var=y;run;229.964721.42507150name of var i a

39、bie = ymean of work iser i esstandard dev i at i on number of observat ionslagcovar i anceautocorre i at ions11112222201234 567 8901234567 8901234,459.0341.00000 4 * 1 aaa * a a a 1 * aaa * aaa 1 i i t i 1 t < t i 1 1 i 1 1 45 1 354038327 | | | j j | | | j 丁 i | 442.8340.96471a >>433.6160.9

40、446342合4330.92255 is ale aisqaala ai>alg 1 ga 1 ti> g412.5730.89879.a*aa* a *aa.aa401.4970.87486390.0300.84968 ftf£/ j ( < j < ® w * jj *y i t i i y i i 378 7840.82518367.8950.80102«x «x»356&7207770111&,,1a * aa *1,'* a a1 *1345.4660752599334.0220.727

41、66322.3230.70218 *al*algaft* a a «11!i1jji<<1|1j310623067669xf klf <a>«x> «x>«xal»«*/299.493065244 丄 a*« a < rjl > ! < j» < > < < j <.288.8210.629191 1 1 1 1 1 1 1 «1 1 1 1 1 ji278.5890.60690268.1780.58422q *! al

42、g a j a # *> a g aft* a m a£«f®|i<<fi>j(1i.257.4040.56075*«x <x>2464980.53639j» ry®<>ay® ry».235.4660.51296 1 1 1 1 1 1 » 1 1 «1 1 f»f.225.0360.49024214.516046732! 204.1540.44475 faf0«aa<t> rt»*t*corre i a

43、t i onma rks t wo st anda rd errorsstd errorc 008165c 0.13964e 0.178792 0.209437 0.23437s 0256872 0.27601s 0.292932 030803$ 0321626 0.33390e 0.34502s 03551 is 0364251 037253e 0.38007s 0.386961 039325e 0.39900c 0.4042 is 0.40894? 0.41321e 041707 0.42055c如itocorrelation check for white noisetolagchi-s

44、quaredfpr > chisqhulrd 丨 ai 15 2810.78<00010.9830.9650.9450.9230.8990.875121417.6812<.00010.8500.8250.8010.7770.7530.728181837.8518<.00010.7020.6770.6520.6290.6070.584242107.4724<.00010.5610.5370.5130.4900.4670.445可以看11!yt不平稳,我们对其进行一阶差分,令:zr = yr-yr_lf做变换如下:bt - t(b)zt - 0.055428 乙(3)

45、 计算勺 切的交叉相关系数,识別初步传递模型。data ex;input x y ;t=_n_;cards;proc arima;identi£y var=x (1) noprint;estimate p=l q=l noconstant;identify var=y(1) crosscor= (x (1) nlag=10;run;both series have beeo prewhitened.croscorreiat ioos-3-2 -1012345678900987654 a 1 - - l covariance-0.031385 -0.020888 0.0233700.0

46、028168 -0.031703 0.000949530.00581870.0035561 0045934 0.017195 0.0020583 0.00354310.3591860.2659500.167533 . 1 18099 0125509 0098845 0.076266 0.054369correlat ion05844 -03889 004351 0.00524 -.05903 0.00177 0.01083uu4b ik 0.01779 0.08552 0.03201 0.00383 0.00660 0.66876 0.49516 0.31192 021988 0.23368

47、0.18404 0.14200 0.10123 138765432101234567891ihhehe4c4cchcatehc* choech<wch«.marks two starxiard errorscrosscorre i at i on check between ser i estochi-pr >lacsqueiredfcbisd5117.836<0001crosscorre i eit i ons0.0320.0040.0070.6690.4950.312both variables havebeen prewhitened by the follow)nc filter:prewhiteninc f ii terautoreressive factorsfactor 1:1 + 0 2131condi t ionaileast squaresest ibat ionstandard errorapproxlac variable shiftscale10

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论