0

I am building a dynamic regression model in Stata which basically has this form: $$Y = a_1x_1 + a_2x_2 +... + e$$ where the error $e$ is then modeled as ARIMA process.

Is there a command to find optimal ARIMA order for the error? In R we can use the auto_arima function to do it; how can I do this in Stata?

Nick Stauner
  • 11,558
  • 5
  • 47
  • 105

1 Answers1

6

There's no automated Stata version as far as I know.

The Hyndman-Khandakar algorithm that auto.arima() uses to pick p,d, and q is described here. The basic steps are:

  1. The number of differences d is determined using repeated KPSS tests.
  2. The values of p and q are then chosen by minimizing the AICc after differencing the data d times. Rather than considering every possible combination of p and q, the algorithm uses a stepwise search to traverse the model space.

(a) The best model (with smallest AICc) is selected from the following four:

  • ARIMA(2,d,2)
  • ARIMA(0,d,0)
  • ARIMA(1,d,0)
  • ARIMA(0,d,1).

If d=0 then the constant c is included; if d≥1 then the constant c is set to zero. This is called the "current model".

(b) Variations on the current model are considered:

  • vary p and/or q from the current model by ±1
  • include/exclude c from the current model.

The best model considered so far (either the current model, or one of these variations) becomes the new current model.

(c) Repeat Step 2(b) until no lower AICc can be found.

All of the tests/statistics involved can be calculated with Stata, so you could achieve something similar by hand, and automate it with a bit more effort. For KPSS, use Chris Baum's kpss from SSC. You can get the corrected AIC by using estat ic and this formula.

dimitriy
  • 31,081
  • 5
  • 63
  • 138