时序第五章上机作业_第1页
时序第五章上机作业_第2页
时序第五章上机作业_第3页
时序第五章上机作业_第4页
时序第五章上机作业_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

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

文档简介

5.1对原序列进行一阶差分:以线性模型为确定性模型,残差序列有:Coefficients: ar1 ar2 ar3 ar4 ar5 ar6 ar7 0 0 0 0.184 0 0 0s.e. 0 0 0 0.096 0 0 0xt=xt-1+tt=0.18t-4+at5.2 程序如下: Box.test(tt,type=Box,lag=1) Box-Pierce testdata: ttX-squared = 7.2043, df = 1, p-value = 0.007273 非白噪声用AR(1)拟合 ttt tttCall:arima(x = tt, order = c(1, 0, 0), method = ML)Coefficients: ar1 intercept 均值不通过检验 0.6418 11.8016s.e. 0.1707 2.6969sigma2 estimated as 22.13: log likelihood = -62.58, aic = 131.16 ttt tttCall:arima(x = tt, order = c(1, 0, 0), include.mean = F, method = ML)Coefficients: ar1 0.9360s.e. 0.0672sigma2 estimated as 26.25: log likelihood = -65.15, aic = 134.3 Box.test(ttt$residuals,type=Ljung,lag=2) Box-Ljung testdata: ttt$residualsX-squared = 0.0196, df = 2, p-value = 0.9902 Box.test(ttt$residuals,type=Ljung,lag=3) Box-Ljung testdata: ttt$residualsX-squared = 3.9735, df = 3, p-value = 0.2643 Box.test(ttt$residuals,type=Ljung,lag=4) Box-Ljung testdata: ttt$residualsX-squared = 4.1526, df = 4, p-value = 0.3857 Box.test(ttt$residuals,type=Ljung,lag=5) Box-Ljung testdata: ttt$residualsX-squared = 4.2351, df = 5, p-value = 0.5161 Box.test(ttt$residuals,type=Ljung,lag=6) Box-Ljung testdata: ttt$residualsX-squared = 4.4922, df = 6, p-value = 0.6104 Box.test(ttt$residuals,type=Ljung,lag=7) Box-Ljung testdata: ttt$residualsX-squared = 4.5936, df = 7, p-value = 0.7094 Box.test(ttt$residuals,type=Ljung,lag=8) Box-Ljung testdata: ttt$residualsX-squared = 6.2873, df = 8, p-value = 0.6151 Box.test(ttt$residuals,type=Ljung,lag=9) Box-Ljung testdata: ttt$residualsX-squared = 6.7998, df = 9, p-value = 0.658 Box.test(ttt$residuals,type=Ljung,lag=10) Box-Ljung testdata: ttt$residualsX-squared = 8.0904, df = 10, p-value = 0.62残差为白噪声序列 tp tp$predTime Series:Start = 22 End = 26 Frequency = 1 1 11.232353 10.513812 9.841237 9.211687 8.6224095.3再做12步差分Coefficients: ma1 -0.4889s.e. 0.1205经过几个模型比较,最终参数通过显著性检验,残差项是白噪声。模型为:121xt=(1-0.49B)t5.4从自相关图和偏自相关图中可以看出,时间序列是平稳的。自相关系数1阶截尾,偏自相关系数1阶截尾,所以使用arma(1,1)模型。Coefficients: ar1 ma1 intercept 0.3020 0.2054 6.7394s.e. 0.1923 0.1952 0.8858sigma2 estimated as 26.6: log likelihood = -306.08, aic = 620.16可以发现,模型参数不显著 ar1 intercept 0.4616 6.7625s.e. 0.0885 0.9550sigma2 estimated as 26.88: log likelihood = -306.58, aic = 619.15Coefficients: ma1 intercept 0.4435 6.7102s.e. 0.0782 0.7504sigma2 estimated as 27.19: log likelihood = -307.15, aic = 620.3并且参数系数通过检验,残差序列可视为白噪声。所以,我们最终确定模型为AR(1)模型:xt=3.6409+0.4616*xt-1+t(2)画残差平方图,可以确定残差序列存在异方差:通过残差的acf,和残差平方的acf图,以及随机性检验得出残差非白噪声,可以假设残差有arch性质。得到条件异方差模型的残差项近似为白噪声,无arch效应。5.5一阶差分后,自相关系数图显示,除了延迟1阶和3阶,其他的自相关系数基本都在2倍标准差之内,有短期相关性,差分序列平稳。偏自相关系数图显示,除了前3期偏自相关系数在2倍标准差外,其他基本在内。arima(3,1,3)模型来模拟。arima(x = dsheep, order = c(3 1,4), method = CSS)Coefficients: ar1 ar2 ar3 ma1 ma2 ma3 ma4 0.3394 0.0695 -0.6031 -0.9212 -0.4796 0.5143 -0.2698s.

温馨提示

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

评论

0/150

提交评论