开始使用免费开始使用

Build time series forecast at regional level

Sometimes you don't have the time to build forecasts for every product, so we take a top-down approach to hierarchical forecasting. Let's work on the metropolitan region in reverse this time!

Your workspace has the following objects pre-loaded: MET_total for the total regional sales, dates_valid, and MET_t_v for the valiation data set.

本练习是课程的一部分

Forecasting Product Demand in R

查看课程

练习说明

  • Build a time series model for all the sales in the metropolitan region (MET_total).
  • Forecast out 22 values into 2017 from this model.
  • Make this forecast into an xts object.
  • Calculate the MAPE.

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Build a regional time series model using auto.arima
MET_t_model_arima <- ___(___)

# Calculate a 2017 forecast for 22 periods from the above model
for_MET_t <- ___(___, h = ___)

# Make an xts object from your forecast
for_MET_t_xts <- ___(___$mean, order.by = ___)

# Calculate the MAPE
MAPE <- mape(___, ___)
print(MAPE)
编辑并运行代码