Problems with modeling the seasonal ARIMA model

I am trying to create a simulation from a seasonal arima model using the forecast package in R with the following command:

simulate(model_temp) 

where model_temp is the result of applying the arima() function to my observed time series and with which, by the way, I indicated the model as ARIMA (2,1,2) (0,1,2) [12].

However, when I try to do this, I get the following error:

 Error in diffinv.vector(x, lag, differences, xi) : NA/NaN/Inf in foreign function call (arg 1) 

Can someone explain why this is so (and how to avoid this problem)?

I have to add that I know that the model I applied and as a result of fitting model_temp is not the model that generated the series, but nevertheless I would like to generate modeling from this model (or any other model if that’s it).

Finally, is it possible to generate simulations from the seasonal ARIMA model by simply specifying the parameters ar, d, ma, sar, sd, sma and sigma without first creating an object of the correct ARIMA type?

Thanks for any help

Jonathan

+4
source share
1 answer

This happens when you have no values, as in the following example.

 library(forecast) x <- WWWusage x[10] <- NA fit <- Arima(x,c(3,1,0), seasonal=list(order=c(0,1,1),period=12)) simulate(fit) # Fails 

By default, arguments model future values ​​conditional on data and fail if some values ​​are missing. If you need an unrelated pattern, you can add future=FALSE .

 simulate(fit, future=FALSE) # Does not fail 

For modeling with an arbitrary model, you can try to build a minimal Arima object, with the necessary data.

 m <- list( arma=c(3,0,0,1,12,1,1), model=list( phi=c(1.17, -0.71, 0.39), theta=c(0,0,0,0,0,0,0,0,0,0,0,-.79) ), sigma2=11, x=NA ) simulate.Arima(m, nsim=30, future=FALSE) 
+4
source

Source: https://habr.com/ru/post/1399708/


All Articles