简体   繁体   English

在 R 的 auto.arima() function 中,我如何找到该 arima 的 p、d、q 值

[英]In the auto.arima() function in R, how do I find the p,d,q values for that arima

I used an R code with an auto.arima function on a time series data set to forecast.我在要预测的时间序列数据集上使用了 R 代码和auto.arima function 代码。 From here, Id like to know how to find the p,d,q values for the arima.从这里,我想知道如何找到 arima 的 p,d,q 值。 Is there a quick way to determine that, thank you.有没有快速的方法来确定,谢谢。

The forecast::auto.arima() function was written to pick the optimal p, d, and q with respect to some optimization criterion (eg AIC).编写forecast::auto.arima() function 是为了根据某些优化标准(例如 AIC)选择最佳 p、d 和 q。 If you want to see which model was picked, use the summary() function.如果您想查看选择了哪个 model,请使用summary() function。

For example:例如:

fit <- auto.arima(lynx)
summary(fit)
 Series: lynx ARIMA(2,0,2) with non-zero mean Coefficients: ar1 ar2 ma1 ma2 mean 1.3421 -0.6738 -0.2027 -0.2564 1544.4039 se 0.0984 0.0801 0.1261 0.1097 131.9242 sigma^2 estimated as 761965: log likelihood=-932.08 AIC=1876.17 AICc=1876.95 BIC=1892.58 Training set error measures: ME RMSE MAE MPE MAPE MASE ACF1 Training set -1.608903 853.5488 610.1112 -63.90926 140.7693 0.7343143 -0.01267127

Where you can see the particular specification in the second row of the output.您可以在 output 的第二行中看到特定规格。 In this example, auto.arima picks an ARIMA(2,0,2).在此示例中, auto.arima选择 ARIMA(2,0,2)。

Note that I did this naively here for demonstration purposes.请注意,出于演示目的,我在这里天真地这样做了。 I didn't check whether this is an accurate representation of the dependency structure in the lynx data set.我没有检查这是否是lynx数据集中依赖结构的准确表示。

Other than summary() , you could also use arimaorder(fit) to get the vector c(p,d,q) or as.character(fit) to get "ARIMA(p,d,q)" .除了summary()之外,您还可以使用arimaorder(fit)来获取向量c(p,d,q)as.character(fit)来获取"ARIMA(p,d,q)"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM