Create future predictor variables
To get forecasts for the regression models with price, holidays, and promotions we need future values for each of these inputs! For our high end product we previously determined holidays and promotions aren't important to the model. Prices are negotiated 6 months in advance, so the prices in the validation data set are reasonable to use for forecast calculations. Your validation data set is stored in your workspace as bev_xts_valid.
本练习是课程的一部分
Forecasting Product Demand in R
练习说明
- Store the log of the prices (stored as the variable
MET.hi.p) from your validation data set as a vector usingas.vector(). - Create a validation data frame using
l_MET_hi_p_validand set the column names using the provided code.
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Subset the validation prices #
l_MET_hi_p_valid <- as.vector(___(bev_xts_valid[,"___"]))
# Create a validation data frame #
MET_hi_valid <- data.frame(___)
colnames(MET_hi_valid) <- "log_price"