R中auto.arima模型选择的解释和再现

时间:2018-04-08 09:35:51

标签: r arima

在RStudio中,我在内置的乘客数据(AirPassengers)上运行auto.arima。数据似乎有乘法趋势。预测结果似乎相当准确。

enter image description here

# Load the corresponging library.
library(forecast)

# Save the default parameters.
defaultPar <- par(no.readonly = TRUE)

# Prepare a graph of four (2x2) subgraphs
par(mfrow = c(3, 1))

# Fit the model. Use the built in AirPassengers data.
modelAA <- auto.arima(AirPassengers)

plot(AirPassengers, 
     main = 'Air passengers', 
     col = 'purple',
     ylab = 'Passengers number', 
     xlab = 'Year')

plot(forecast(modelAA, 24), 
     main = 'Air passengers + auto.arima forecasting', 
     col = 'red',
     ylab = 'Passengers number', 
     xlab = 'Year')

qqnorm(modelAA$residuals, col = 'red')
qqline(modelAA$residuals, col = 'green')

# Restore the default parameters.
par(defaultPar)

如下面的代码示例所示,自动ARIMA预测选择了以下模型:(2,1,1)(0,1,0)[12]。

print(modelAA)
Series: AirPassengers 
ARIMA(2,1,1)(0,1,0)[12] 

Coefficients:
         ar1     ar2      ma1
      0.5960  0.2143  -0.9819
s.e.  0.0888  0.0880   0.0292

sigma^2 estimated as 132.3:  log likelihood=-504.92
AIC=1017.85   AICc=1018.17   BIC=1029.35

如何解释自动选择(2,1,1)(0,1,0)[12]并通过调用arima(x,order = c()...)来重现它?感谢。

1 个答案:

答案 0 :(得分:0)

季节性华丽模型。您可以从enter link description here获取详细信息。

enter image description here

当您致电order/sensonal/period period = 12时,您应将arima设置为function (x, order = c(0L, 0L, 0L), seasonal = list(order = c(0L, 0L, 0L), period = NA), xreg = NULL, include.mean = TRUE, transform.pars = TRUE, fixed = NULL, init = NULL, method = c("CSS-ML", "ML", "CSS"), n.cond, SSinit = c("Gardner1980", "Rossignol2011"), optim.method = "BFGS", optim.control = list(), kappa = 1e+06)