Seasonal / holiday / promotional effects

Forecasting Product Demand in R

Aric LaBarr, Ph.D.

Senior Data Scientist, Elder Research

Influencers of Demand

  • Seasonal effects
    • Examples: Winter coats, bathing suits, school supplies, etc.
  • Holiday effects
    • Examples: Retail sales, holiday decorations, candy, etc.
  • Promotion effects
    • Examples: Digital marketing, shelf optimization, etc.
Forecasting Product Demand in R

Seasonal / Holiday / Promotion?

plot(M_hi)

plot(M_hi_p)

Forecasting Product Demand in R

Forecasting Product Demand in R

Linear Regression! Again...

  • Linear regression helps us evaluate the relationship between many factors and demand, not just price.
  • Add seasonal, holiday, and promotion effects to previous regression!
  • Any of these effects statistically significant?
    • Are the effects due to random chance or not?
Forecasting Product Demand in R

Creating Effects Example

v.dates <- as.Date(c("2014-02-09", "2015-02-08", "2016-02-07"))
valentine <- as.xts(rep(1, 3), order.by = v.dates)

dates_train <- seq(as.Date("2014-01-19"), length = 154, by = "weeks") valentine <- merge(valentine, dates_train, fill = 0)
head(valentine, n = 5)
           valentine
2014-01-19         0
2014-01-26         0
2014-02-02         0
2014-02-09         1
2014-02-16         0
Forecasting Product Demand in R

Adding Effects Example

M_hi_train <- data.frame(M_hi_train, as.vector(valentine))

model_M_hi_full <- lm(log_sales ~ log_price + valentine, 
                      data = M_hi_train)

summary(model_M_hi_full)
Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  8.93102    0.44693  19.983  < 2e-16 ***
log_price   -0.70010    0.11103  -6.306    3e-09 ***
valentine    0.22942    0.07547   3.040  0.00279 ** 

Signif. codes:  0 *** 0.001 ** 0.01 * 0.05 . 0.1   1
Forecasting Product Demand in R

Let's practice!

Forecasting Product Demand in R

Preparing Video For Download...