Automatic forecasting with exponential smoothing
The namesake function for finding errors, trend, and seasonality (ETS) provides a completely automatic way of producing forecasts for a wide range of time series.
You will now test it on two series, austa
and hyndsight
, that you have previously looked at in this chapter. Both have been pre-loaded into your workspace.
This exercise is part of the course
Forecasting in R
Exercise instructions
- Using
ets()
, fit an ETS model toausta
and save this tofitaus
. - Using the appropriate function, check the residuals from this model.
- Plot forecasts from this model by using
forecast()
andautoplot()
together. - Repeat these three steps for the
hyndsight
data and save this model tofiths
. - Which model(s) fails the Ljung-Box test? Assign
fitausfail
andfithsfail
to eitherTRUE
(if the test fails) orFALSE
(if the test passes).
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Fit ETS model to austa in fitaus
___ <- ___(___)
# Check residuals
___(___)
# Plot forecasts
___(___(___))
# Repeat for hyndsight data in fiths
fiths <- ___(___)
___(___)
___(___(___))
# Which model(s) fails test? (TRUE or FALSE)
fitausfail <- ___
fithsfail <- ___