16
$\begingroup$

How can I get p,d and q values in ARIMA(p,d,q) model estimated by auto.arima(mytimeseries)?

arima_model <- auto.arima(mytimeseries,ic='bic')

If we look at the output of

arima_model$arma

we get,

[1] 1 0 0 0 1 2 0

What is the meaning of the numbers appear in above sequence?

$\endgroup$

3 Answers 3

22
$\begingroup$

Try this:

fit <- auto.arima(WWWusage)
arimaorder(fit)
$\endgroup$
2
  • 1
    $\begingroup$ So what did the numbers in his output mean? $\endgroup$
    – Hack-R
    Nov 29, 2016 at 18:22
  • $\begingroup$ Read the arima help file: "A compact form of the specification, as a vector giving the number of AR, MA, seasonal AR and seasonal MA coefficients, plus the period and the number of non-seasonal and seasonal differences." $\endgroup$ Nov 29, 2016 at 21:09
4
$\begingroup$

If you look at the help file of auto.arima and navigate to the section "Value", you are directed to the help file of arima function and there you find the following (under the section "Value") regarding the arma slot:

A compact form of the specification, as a vector giving the number of AR, MA, seasonal AR and seasonal MA coefficients, plus the period and the number of non-seasonal and seasonal differences.

That is what the seven elements you reported correspond to. In your case, you have a non-seasonal ARIMA(1,2,0).

$\endgroup$
1
$\begingroup$

In case, it might be easier to understand for some people:

non_seasonal_ar_order = model_fit$arma[1]
non_seasonal_ma_order = model_fit$arma[2]

seasonal_ar_order = model_fit$arma[3]
seasonal_ma_order = model_fit$arma[4]

period_of_data = model_fit$arma[5] # 1 for is non-seasonal data

non_seasonal_diff_order = model_fit$arma[6]
seasonal_diff_order =  model_fit$arma[7]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.