Issues with simulating a seasonal ARIMA model

删除回忆录丶 提交于 2019-12-05 06:44:20

This happens when you have missing 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

The default arguments simulate future values conditional on the data, and fails if some values are missing. If you want an unrelated sample, you can add future=FALSE.

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

To simulate from an arbitrary model, you can try to build a minimal Arima object, with only the data needed.

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)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!