Automatic ARIMA models for non-seasonal time series
In the video, you learned that the auto.arima()
function will select an appropriate autoregressive integrated moving average (ARIMA) model given a time series, just like the ets()
function does for ETS models. The summary()
function can provide some additional insights:
> # p = 2, d = 1, p = 2
> summary(fit)
Series: usnetelec
ARIMA(2,1,2) with drift
...
In this exercise, you will automatically choose an ARIMA model for the pre-loaded austa
series, which contains the annual number of international visitors to Australia from 1980-2015. You will then check the residuals (recall that a p-value greater than 0.05 indicates that the data resembles white noise) and produce some forecasts. Other than the modelling function, this is identicial to what you did with ETS forecasting.
This exercise is part of the course
Forecasting in R
Exercise instructions
- Fit an automatic ARIMA model to the
austa
series using the newly introduced function. Save this tofit
. - Use the appropriate function to check that the residuals of the resulting model look like white noise. Assign
TRUE
(if the residuals look like white noise) orFALSE
(if they don't) toresidualsok
. - Apply
summary()
to the model to see the fitted coefficients. - Based on the results using
summary()
, what is the AICc value to two decimal places? How many differences were used? Assign these toAICc
andd
, respectively. - Finally, using the pipe operator, plot forecasts of the next 10 periods from the chosen model.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Fit an automatic ARIMA model to the austa series
fit <- ___
# Check that the residuals look like white noise
___
residualsok <- ___
# Summarize the model
___
# Find the AICc value and the number of differences used
AICc <- ___
d <- ___
# Plot forecasts of fit
fit %>% forecast(h = ___) %>% ___()