CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Forecasting in R

Afficher le cours

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.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Plot the data
___

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

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

# Plot forecasts
___
Modifier et exécuter le code