I am trying to solve a problem for a brewery:

A brewery has 50 beer types in total out of which only 8 to 10 beers are available on tap for a single day i.e only 8 to 10 beers will be sold on any given day. The combination were selected randomly as of now. How to find the best beer type combination which will yield maximum sales. And depending on the best combinations(3-4) I want to forecast sales of individual beer to understand the quantity requirement in the future. Also i wanted to know the contribution of individual beer on the total sales forecast. how to find the best combination of products and then forecast sales, and after forecasting again determine the contribution of individual products?

Example of how the data looks like:


Potential problems: I have just 1000 days data. I can forecast total sales as it is continuous, but when dealing with individual beer it has a lot of gaps/intervals in the time series.

Appreciate if you can give an solution/example in r.

  • 1
    $\begingroup$ How do you feel about correlations: consumer prefer beer "A", but when unavailable they switch to beer "B", their second best ? $\endgroup$ – AlainD Aug 29 '18 at 14:37

Your question is a little bit confusing. Are you trying to disaggregate a total forecast (A)? Or are trying to find an optimal combination of beers to maximize sales (B)?

If (A) then what you are trying to do is called Top-Down hierarchical forecasting:


If (B) then what you are trying to do is called Assortment Planning or Assortment optimization. In which case you are no longer dealing with a forecasting problem, but a combined forecasting and (potentially non linear) optimization problem.



You may google "Design of experiments" to find theory and formula.

As a first approach, I would recommend a linear regression without interaction (in R: Total ~ Beer1 + Beer2 +...+Beer50). And checking if the F is significant or by an other way taht the multicollinearity does not smash down your regression (you have collinearity, the question is does the conclusions drawn out of the regression survive). Normally all the coefficients should be 1, but the summary will also give you their significativity, by which you will know if a certain beer had an significant impact on the daily sales.

Then, do a linear regression with interactions (in R: Total = Beer1 + Bear2 + Beer50 + Beer 1*Beer2 + ... + Beer1*Beer50 +...+ Beer50*50), to know the impact of BeerA missing on BeerB consumption. Of course, you cannot do this directly (because you have $50 \cdot 50 = 2500$ variables and 1000 cases (not to mention writing the line of code). But, with step 1, you should be able to concentrate on interactions with the 3-4 more beers that contributed most surely to the daily sales.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.