Forecasting with ARIMA models
The automatic method in the previous exercise chose an ARIMA(0,1,1) with drift model for the austa
data, that is,
\(y_t = c + y_{t-1} + \theta e_{t-1} + e_t.\)
You will now experiment with various other ARIMA models for the data to see what difference it makes to the forecasts.
The Arima()
function can be used to select a specific ARIMA model. Its first argument, order
, is set to a vector that specifies the values of \(p\), \(d\) and \(q\). The second argument, include.constant
, is a boolean that determines if the constant \(c\), or drift, should be included. Below is an example of a pipe function that would plot forecasts of usnetelec
from an ARIMA(2,1,2) model with drift:
> usnetelec %>%
Arima(order = c(2,1,2), include.constant = TRUE) %>%
forecast() %>%
autoplot()
In the examples here, watch for how the different models affect the forecasts and the prediction intervals. The austa
data is ready for you to use in your workspace.
This exercise is part of the course
Forecasting in R
Exercise instructions
- Plot forecasts from an ARIMA(0,1,1) model with no drift.
- Plot forecasts from an ARIMA(2,1,3) model with drift.
- Plot forecasts from an ARIMA(0,0,1) model with a constant.
- Plot forecasts from an ARIMA(0,2,1) model with no constant.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Plot forecasts from an ARIMA(0,1,1) model with no drift
austa %>% Arima(order = c(___, ___, ___), include.constant = ___) %>% ___ %>% ___
# Plot forecasts from an ARIMA(2,1,3) model with drift
austa %>% Arima(___, ___) %>% ___ %>% ___
# Plot forecasts from an ARIMA(0,0,1) model with a constant
austa %>% Arima(___, ___) %>% ___ %>% ___
# Plot forecasts from an ARIMA(0,2,1) model with no constant
austa %>% Arima(___, ___) %>% ___ %>% ___