Holt-Winters with monthly data
In the video, you learned that the hw()
function produces forecasts using the Holt-Winters method specific to whatever you set equal to the seasonal
argument:
fc1 <- hw(aust, seasonal = "additive")
fc2 <- hw(aust, seasonal = "multiplicative")
Here, you will apply hw()
to a10
, the monthly sales of anti-diabetic drugs in Australia from 1991 to 2008. The data are available in your workspace.
Diese Übung ist Teil des Kurses
Forecasting in R
Anleitung zur Übung
- Produce a time plot of the
a10
data. - Produce forecasts for the next 3 years using
hw()
with multiplicative seasonality and save this tofc
. - Do the residuals look like white noise? Check them using the appropriate function and set
whitenoise
to eitherTRUE
orFALSE
. - Plot a time plot of the forecasts.
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Plot the data
___
# Produce 3 year forecasts
fc <- hw(___, seasonal = ___, h = ___)
# Check if residuals look like white noise
___
whitenoise <- ___
# Plot forecasts
___