Specify order of ARIMA using Fable package

259 views Asked by At

I am running an ARIMA model using the fable package. Just curious to find out whether there is a way to specify the order of the model (e.g specifying an order of 2,1,1) when using the ARIMA function in the package as opposed to using the optimal lags which are specified automatically?

Also trying to figure out the best way to add a vector as a dummy variable in order to control for a structural break for the first observation

I've used the built in dataset in the package (tourism)

library(fable)

fit <- tourism %>% slice(tail(row_number(), 10)) %>% 
  model(arima = ARIMA(Trips))

TIA!

1

There are 1 answers

0
David Moore On BEST ANSWER

If you check out the help page for this ARIMA() function, it says how to specify p, d, and q, and it provides a nice example:

# Manual ARIMA specification
USAccDeaths %>%
  as_tsibble() %>%
  model(arima = ARIMA(log(value) ~ 0 + pdq(0, 1, 1) + PDQ(0, 1, 1))) %>%
  report()

You can specify numbers (or ranges of numbers that it can use to determine which one is the best fit) for p, d, and q in the right-hand side of the formula argument within the ARIMA() function. pdq() is for non-seasonal components and PDQ() is for seasonal components.

It also says:

To force a nonseasonal fit, specify PDQ(0, 0, 0) in the RHS of the model formula.

I'm not exactly sure what you're trying to accomplish with the dummy variable. Could you provide a reproducible example?