当我试图在 R 中找到 ARIMA 模型的最佳参数时,这个问题发生了好几次。下面是一个例子:
我的数据是:
22 41 34 29 27 41 37 17 40 38 31 25 27 30 36 42 26 31 28 20 36 37 39 29 53 59 43 36 33 43 33 17 43 42 52 44 45 51 66 45 38 41 37 37 52 55 43 40 61 45 71 57 66 85 85 37 51 58 50 56 47 63 89 57 54 76 73 51 82 119 108 86
我读取我的数据并将其转换为 ts 对象:
data <- read.table('test_data.txt')
data <- as.data.frame(t(data))
ts.test <- ts(data, start = c(2014, 1), frequency = 12)
我尝试使用auto.arima()
外生变量找到最佳参数tt
:
tt <- seq(length(ts.test))
auto.arima(ts.test, xreg = tt)
结果如下:
## Series: ts.test
## Regression with ARIMA(0,0,1)(2,0,0)[12] errors
##
## Coefficients:
## ma1 sar1 sar2 intercept xreg
## 0.5386 0.2667 0.2558 21.7004 0.7458
## s.e. 0.0951 0.1298 0.1515 5.3415 0.1128
##
## sigma^2 estimated as 132.9: log likelihood=-277.4
## AIC=566.79 AICc=568.09 BIC=580.45
当我尝试Arima()
:
Arima(ts.test, xreg = tt, order = c(0, 0, 1),
seasonal = list(order = c(2, 0, 0), period = 12))
auto.arima()
它在以下方面给出了相同的结果和 AIC 以及可能性:
## Series: ts.test
## Regression with ARIMA(0,0,1)(2,0,0)[12] errors
## Coefficients:
## ma1 sar1 sar2 intercept xreg
## 0.5386 0.2667 0.2558 21.7004 0.7458
## s.e. 0.0951 0.1298 0.1515 5.3415 0.1128
##
## sigma^2 estimated as 132.9: log likelihood=-277.4
## AIC=566.79 AICc=568.09 BIC=580.45
但是当我尝试适应它时arima()
:
arima(ts.test, xreg = tt, order = c(0, 0, 1),
seasonal = list(order = c(2, 0, 0), period = 12))
它给了我:
## Call:
## arima(x = ts.test, order = c(0, 0, 1), seasonal = list(order = c(2, 0, 0), period = 12), xreg = tt)
##
## Coefficients:
## ma1 sar1 sar2 intercept xreg
## 0.5386 0.2667 0.2558 21.7004 0.7458
## s.e. 0.0951 0.1298 0.1515 5.3415 0.1128
##
## sigma^2 estimated as 123.6: log likelihood = -277.4, aic = 564.79
请注意,这 3 个函数给出了相同的参数及其标准误差,但arima()
给出的参数不同和不同的 AIC(总是比其他 AIC 增加 2),而可能性保持不变。
任何人都可以给出解释吗?非常感谢!