Forecasting Product Demand in R
Aric LaBarr, Ph.D.
Senior Data Scientist, Elder Research
As price changes, it is expected that demand changes as well, but how much?
$$ \text{Price Elasticity} = \frac {\% \text{Change in Demand}}{\% \text{Change in Price}} $$
M_hi <- as.vector(bev_xts_train[,"M.hi"]) M_hi_p <- as.vector(bev_xts_train[,"M.hi.p"])
M_hi_train <- data.frame(log(M_hi), log(M_hi_p)) colnames(M_hi_train) <- c("log_sales", "log_price")
model_M_hi <- lm(log_sales ~ log_price, data = M_hi_train)
Coefficients:
(Intercept) log_price
8.9907 -0.7138
Forecasting Product Demand in R