|
本人新手。。目前在看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
代码完全是按照书上来做的,可是出现这样子的结果,想问下各位是怎么回事?可以怎么解决?
|
|