R:预测:找到arfima和nnetar预测的准确性

时间:2016-01-28 23:28:23

标签: r forecasting

我正在尝试使用预测包找到arfima和nnetar预测的准确性。但是我收到了一条错误消息。

library(forecast)
library(fracdiff)
x <- fracdiff.sim( 100, ma=-.4, d=.3)$series 
fit <- arfima(x)
accuracy(fit)

Error in accuracy(fit) : 
  First argument should be a forecast object or a time series.

fit <-nnetar(x)
accuracy(fit)

Error in accuracy(fit) : 
  First argument should be a forecast object or a time series.

我很感激你的帮助,指出我做错了什么。

1 个答案:

答案 0 :(得分:0)

首先,您需要预测语法,例如

forecast(fit)

然后

accuracy(forecast(fit), x, test=NULL, d=NULL, D=NULL)