基本上我们可以从 auto.arima 中提取最佳 AR 顺序
> auto.arima(ret.fin.chn,trace=TRUE,allowdrift=TRUE)
ARIMA(2,0,2) with non-zero mean : -14242.19
ARIMA(0,0,0) with non-zero mean : -14239.24
ARIMA(1,0,0) with non-zero mean : -14241.3
ARIMA(0,0,1) with non-zero mean : -14238.16
ARIMA(1,0,2) with non-zero mean : -14237.65
ARIMA(3,0,2) with non-zero mean : -14242.72
ARIMA(3,0,1) with non-zero mean : -14239.52
ARIMA(3,0,3) with non-zero mean : -14242.5
ARIMA(2,0,1) with non-zero mean : -14237.15
ARIMA(4,0,3) with non-zero mean : -14238.06
ARIMA(3,0,2) with zero mean : -14244.39
ARIMA(2,0,2) with zero mean : -14243.98
ARIMA(4,0,2) with zero mean : -14241.45
ARIMA(3,0,1) with zero mean : -14241.23
ARIMA(3,0,3) with zero mean : -14244.04
ARIMA(2,0,1) with zero mean : -14238.78
ARIMA(4,0,3) with zero mean : -14239.73
Best model: ARIMA(3,0,2) with zero mean
Series: ret.fin.chn
ARIMA(3,0,2) with zero mean
Coefficients:
ar1 ar2 ar3 ma1 ma2
0.5497 -0.4887 0.0461 -0.5691 0.4923
s.e. 0.3525 0.1764 0.0232 0.3534 0.1878
sigma^2 estimated as 0.0003277: log likelihood=7127.67
AIC=-14243.35 AICc=-14243.32 BIC=-14207.83
Warning messages:
1: In if (is.constant(x)) { :
the condition has length > 1 and only the first element will be used
2: In if (is.constant(x)) return(d) :
the condition has length > 1 and only the first element will be used
3: In if (is.constant(dx)) { :
the condition has length > 1 and only the first element will be used
现在将结果存储到对象 a
> a<-auto.arima(ts(ret.fin.chn),trace=TRUE,allowdrift=TRUE)
然后
> a$arma[1]
而对于最佳 MA 订单
> a$arma[2]
现在看看这部分最佳模型:平均为零的 ARIMA(3,0,2)
这是 ARIMA(p,d,q) 顺序我知道如何提取 AR(p) 和 MA(q) 顺序但是如何提取集成(d)顺序并注意我已经尝试过ndiffs
,有时它给出的结果与最好的模型不同,也许它在某处$arma[?]
???