找回密码
 立即注册
查看: 3114|回复: 0

Rstudio做时间序列ARIMA拟合时候发生错误

[复制链接]
发表于 2017-3-20 16:03:44 | 显示全部楼层 |阅读模式
本人新手。。目前在看R IN ACTION
然后在 15.4 “ARIMA预测模型”一章中用forecas包+tseries包做Nile数据集的arima预测,出现以下错误:

> require(tseries)
> library(forecast)
> fit <- arima(Nile,order = c(3,0,3))
> fit

Call:
arima(x = Nile, order = c(3, 0, 3))

Coefficients:
          ar1     ar2     ar3     ma1      ma2      ma3  intercept
      -0.6320  0.5476  0.7582  1.0787  -0.0737  -0.6288   922.4686
s.e.   0.1287  0.1684  0.0902  0.1960   0.3377   0.1973    52.8730

sigma^2 estimated as 17934:  log likelihood = -633.65,  aic = 1281.31
> accuracy(fit)
              ME RMSE MAE MPE MAPE
Training set NaN  NaN NaN NaN  NaN
Warning message:
In trainingaccuracy(f, test, d, D) : test elements must be within sample
> forecast(fit,3)
Error in ts(x) : 'ts' object must have one or more observations



代码完全是按照书上来做的,可是出现这样子的结果,想问下各位是怎么回事?可以怎么解决?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|R语言中文网

GMT+8, 2024-11-22 20:20 , Processed in 0.029012 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表