0

I have sales data over a number of years for several different products. The products are only on sale for a limited period each year (spring - summer). The data will sometimes be irregularly spaced (products are not always on sale every week during the sales period). There may be seasonality and a yearly trend. I would like to produce advance forecasts for the following year for each week in the sales period. I can't see how this would be done using standard forecasting methods.

1 Answers1

0

This is a linear regression problem with correlated error terms.

  • You have a continuous dependent variable (number of units or sales in currency).
  • You have a predictor "week" which may be treated as a categorical factor, or as continuous regressor.
  • You have another, separate predictor "year," which you should treat as continuous (trend over years).
  • "Product type" may be treated as another categorical predictor (makes sense for a few comparable products), or you may just decide to perform separate estimations for each product.

If your main goal is to make statistical inferences (e.g. to test if one week gives you higher sales on average than others) then linear mixed model is for you (check out the lme4 package in R). Weeks will be clustered within years and weeks closer in time may be more similar to each other. These are dependencies that you may have to account for. Setting up such a longitudinal mixed model is not trivial, but you may find the examples from Chapters 6 and 7 in "Linear Mixed Models: A Practical Guide Using Statistical Software",n by West, Welch, & Galecki useful. Mixed models can handle missing data. To some extent such a model can also be used for predictions.

If your main goal is to obtain reliable forecasts, then a ridge regression or LASSO may be a more straightforward solution. I'm not quite sure whether the correlated errors are a big problem for these approaches, but apparently there is a mixed model-LASSO package for R.

mzunhammer
  • 1,188