Get startedGet started for free

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.

This exercise is part of the course

Forecasting in R

View Course

Exercise instructions

  • Produce a time plot of the a10 data.
  • Produce forecasts for the next 3 years using hw() with multiplicative seasonality and save this to fc.
  • Do the residuals look like white noise? Check them using the appropriate function and set whitenoise to either TRUE or FALSE.
  • Plot a time plot of the forecasts.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Plot the data
___

# Produce 3 year forecasts
fc <- hw(___, seasonal = ___, h = ___)

# Check if residuals look like white noise
___
whitenoise <- ___

# Plot forecasts
___
Edit and Run Code