Exercise

Build time series forecast for new product

Before we can even calculate a bottom-up forecast for the metropolitan region we need to have forecasts of multiple products! First, let's build a time series forecast of the specialty product in the metropolitan region. The product demand is saved as MET_sp in your workspace as well as dates_valid as well as your validation data MET_sp_v.

You've written the MAPE function enough at this point. A mape() function has now been written for you to use with two inputs: the first is the forecast and the second is the validation set.

Instructions

100 XP
  • Use the auto.arima() function to build a time series model for the specialty product MET_sp.
  • Forecast this model for 22 time periods into 2017.
  • Make this forecast into an xts object. You can still use the dates_valid object for the order.by = option.
  • Calculate the MAPE for this forecast with your new mape() function.