2
I am creating a function to run ARIMA models. After storing the function results in an object to do the Accuracy test, returns the following error:
Warning message:
In trainingaccuracy(f, test, d, D) test Elements must be Within sample
However, when it is the model made via the original Arima function, the Accuracy test runs normally.
As in the code:
SARIMA <- function(x,p,d,q,P,D,Q) {
m <- arima(x,order=c(0,1,1), seasonal = list(order = c(0, 1, 1),
period = 12, method="CSS"))
m
}
teste <- arima.sim(n=10000, list(ar=c(0.8), ma=c(-0.3)))
f <- SARIMA(teste,p,d,q,P,D,Q)
f
accuracy(f)
m <- arima(teste,order=c(0,1,1), seasonal = list(order = c(0, 1, 1),
period = 12, method="CSS"))
accuracy(m)
The two objects (f
and m
) are from the "Arima" class and the same "list" mode".
Pq when using SARIMA function does not run Accuracy?
What is the function package
accuracy
?– Marcus Nunes
It’s from the forecast package.
– Rildo