由 30 个值组成的数据存储在时间序列中time。
在 上应用 ARIMA 建模后time,我使用forecast函数来预测未来值:
model = arima(time, order = c(3,2,1))
prediction = forecast.Arima(model,h=10)
prediction step is not working and showing error
Error in ts(x) : object is not a matrix
如您在上面看到的,我收到一条错误消息。但如果我这样做
model = arima(time[1:25], order = c(3,2,1))
prediction = forecast.Arima(model,h=10)
有用。为什么会这样?
当我使用该predict功能时
model = arima(time, order = c(3,2,1))
prediction=predict(model,n.ahead=10)
它也有效。
对于 R 中的 ARIMA 模型,哪个函数更适合使用predict,为什么?forecast