时间序列分析作业.docx
1、某股票连续假设干天的收盘价如下表:304303307299296293301293301295284286286287284282278281278277279278270268272273279279280275271277278279283284282283279280280279278283278270275273273272275273273272273272273271272271273277274274272280282292295295294290291288288290293288289291293293290288287289292288288285282286286287284283286282287286287292292294291288289选择适当模型拟合该序列的开展,并估计下一天的收盘价。解:根据上面的图和SAS软件编辑程序得到时序图,程序如下datashiyan7_l;inputx;time=_n_;cardsr304303307299296293301293301295284286286287284282278281278277279278270268272273279279280275271277278279283284282283279280280279278283278270275273273272275273273272273272273271272271273277274274272280282292295295294290291288288290293288289291293293290288287289292288288285282286286287284283286282287286287292292294291288289proc print data=shiyan7_l;proc gplot data=shiyan7_l; plot x *time=l;symboll c=red v=star i=spline;run;通过SAS运行上述程序可得到如下结果:可以看出序列含有长期趋势又含有一定的周期性,故进行差分平稳,又从上述时序图呈现曲线形式,故对原序列作二阶差分,差分程序及时序图如下:data shiyan7_l;input x;difx=dif(dif(x);time=_n_;cards;304303307299296293301293301295284286286287284282278281278277279278270268272273279279280275271277278279283284282283279280280279278283278270275273273272275273273272273272273271272271273277274274272280282292295295294290291288288290293288289291293293290288287289292288288285282286286287284283286282287286287292292294291288289proc print data=shiyan7_l;proc gplot data=shiyan7_l; plot x *time difx*time;symboll c=red v=star i=join;proc arima;identify var=x(11);estimate q=l;forecast lead=5 id=time;run;SAS软件运行后可得到差分后的序列时序图,其图形如下:时序图显示差分后序列已无显著趋势或周期,随机波动比拟平稳。从上述程序的运行结果可以得到差分后序列的自相关图和偏自相关图,其图形如下:Lag Covariance CorreIation -198765432101234567891012345678901234567890123411111111112222230.4377321.00000:+: :+:+: :+:+:+:*:+:出:+;出:+:出:+; :+: :+: :+:+; :+: :+;0-17.436829-.57287a0.0975903.3609910.11042出出 ,0.125598-0.915203-.03007米0.126519-1.010082-.03319米0.126587-0.989949-.03252喉0.1266700.5983470.019680.1267494.4777990.14711 .0.126778-4.783928-.1551出土生0.1283943.7796510.12418出出 ,0.130198-4.895454-.16084.0.1313213.2858580.10795泵电 .0.133184-1.065983-.03502. 0.1340152.7135150.08915出土 ,0.134102-6.238506-.20496.HMKH»K0.1346657.7127830.25340:+;:+:+:+:+:0.137604-5.113253-.16799. *0.141979-0.104821-.003440.1438591.7616610.05788* .0.143860-0.398977-.013110.1440823.1801580.104480.144093-5.763791-.189360.1448133.1711710.104190.147152-0.637086-.020930.147853-0.132691-.004360.147881Std Error从上述自相关图中可以看出自相关系数一阶之后全都落于2倍标准差之内,故序列是I阶截尾的,q=lPa. rt. i a I Aut. oco r re I at. i ons: :+: HC HCM< MC:+:+:+: :+:+:+:+:+:+:+:+:+:+:.Ht 丽 Hf.H«丽中丽丽丽丽丽. 水二 *-198765432101234567891733709398873715915013796815634314407542171853835249639375420876274048239721204931616292042135121532233010110110001110100OoooooooooooooooooooooooS 123458789012345878901234 a 111111111122222L从上述偏自相关图中可以看出序列是拖尾的P=OAutocorrelation Check of ResidualsToLag8Chi- Square8.27Pr >DF ChiSq50.2808-0.1890.002HUIULUI IDIaLlU12-0.088-0.103-0.0430.0931213.53110.28000.183-0.0710.041-0.1370.0610.0061822.58170.18400.034-0.1470.151-0.144-0.0450.032429.20230.17380.0340.038-0.207-0.008-0.050-0.044而从上述结果中可以看出序列未通过了白噪声检验,是非白噪声序列u IUlLlUlIal Lca L ou 8StandardParameterEstimateError t3L I IIIAL IUIIApprox :Value Pr > tLag