Selene_Chion 发表于 2015-8-4 13:24 
你好,我已经把acf(residual)的图贴上来了,你看一下这样的模型能用吗
另外想问一下,这个warning 是什么 ...
我也试过,好像有这样的提示信息后,auto.arima()建议的最佳模型不见得是最好的。你试试看下面这个。
# 获取最佳模型
get.best.arima <- function(x.ts, maxord = c(1, 1, 1, 1, 1, 1)) {
best.aic <- 1e+08
n <- length(x.ts)
for (p in 0:maxord[1]) for (d in 0:maxord[2]) for (q in 0:maxord[3])
for (P in 0:maxord[4]) for (D in 0:maxord[5]) for (Q in 0:maxord[6]) {
fit <- arima(x.ts, order = c(p, d, q), seas = list(order = c(P, D, Q), frequency(x.ts)), method = "CSS")
fit.aic <- -2 * fit$loglik + (log(n) + 1) * length(fit$coef)
if (fit.aic < best.aic) {
best.aic <- fit.aic
best.fit <- fit
best.model <- c(p, d, q, P, D, Q)
}
}
list(best.aic, best.fit, best.model)
}