Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the order of the model used in auto.arima?

I am trying to use auto.arima on a timeseries. Now I need to know the order of the arima that has been selected. The return value is of type ARIMA, which doesn't hold the order anywhere. (or am I missing the values). Given in code snippet and the output attributes. (This is same as in R Documentation)

    double[] list1 = {0, 0, 2, 1, 2, 10, 21, 0, 0, 3, 6, 5, 11, 51, 0, 11, 8, 6, 24, 25, 104, 0, 0, 6, 4, 5, 25, 71};
    rconnection.assign("myData1", list1);
    rconnection.eval("timeSeries1 <- ts(myData1,start=1,frequency="+staticBookingStage+")");
    REXP fc = rconnection.eval("fitModel1 <- auto.arima(timeSeries1)");

    System.out.println( fc.asList().names);

Output

[coef, sigma2, var.coef, mask, loglik, aic, arma, residuals, call, series, code, n.cond, nobs, model, bic, aicc, x, fitted]

like image 691
Biswajit Jana Avatar asked Oct 20 '25 04:10

Biswajit Jana


1 Answers

Use the arimaorder() function:

library(forecast)
fit <- auto.arima(WWWusage)
arimaorder(fit)
like image 151
Rob Hyndman Avatar answered Oct 22 '25 19:10

Rob Hyndman