Exploring auto.arima() options
The auto.arima()
function needs to estimate a lot of different models, and various short-cuts are used to try to make the function as fast as possible. This can cause a model to be returned which does not actually have the smallest AICc value. To make auto.arima()
work harder to find a good model, add the optional argument stepwise = FALSE
to look at a much larger collection of models.
Here, you will try finding an ARIMA model for the pre-loaded a10
data, which contains monthly anti-diabetic drug subsidies in Australia from 1991 to 2008 in millions of Australian dollars. Inspect it in the console before beginning this exercise.
This exercise is part of the course
Forecasting in R
Exercise instructions
- Use the default options in
auto.arima()
to find an ARIMA model fora10
and save this tofit1
. - Use
auto.arima()
without a stepwise search to find an ARIMA model fora10
and save this tofit2
. - Run
summary()
for bothfit1
andfit2
in your console, and use this to determine the better model. To 2 decimal places, what is its AICc value? Assign the number toAICc
. - Finally, using the better model based on AICc, plot its 2-year forecasts. Set
h
accordingly.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Find an ARIMA model for a10
fit1 <- ___
# Don't use a stepwise search
fit2 <- ___
# AICc of better model
AICc <- ___
# Compute 2-year forecasts from better model
___ %>% ___ %>% ___