If retailer has many products the is likely to be a substitution effect within product groups (clusters).

Hence, there is a notion of the "unit of demand" that is supposed to gather products based on the substitution level.

Is there a tool or an algorithm that allows to identify "units of demand" automatically based on the sales history?

That can potentially improve the quality of the bottom-up approach and therefore provide better information for the purchasing decisions.


Similar items shoud follow a similar sales pattern (if environment is static), but they often do absolutely the opposite in the real life. There are plenty of reasons which are usually beyond the available data:

  • promotion (price reduction) of one item in a group;
  • one item is promoted to the home page;
  • generic colour is added to the group;
  • some items are out of stock.

All these events will cause increase in sales for a subgroup of items while the rest will suffer due to substitution. So if I take the standard deviation per SKU it will be massive, while for the unit of demand it will be non material. Hope that makes sense.


1 Answer 1


That whole area is called "Hierarchical Forecasting". Rob Hyndman has some material that could be helpful to conceptualize the problem.

You could use standard clustering techniques (kmeans, dbscan, hierarchichal clustering, PAM, clara,k-medoids, etc) along with product line classification to identify your "units of demand". Since you are dealing with time series you should use a distance or dissimilarity measure that takes that into consideration. This link to SE discussion https://quant.stackexchange.com/questions/848/time-series-similarity-measures considers several similarities measures that can be helpful. In your case given the substitution effect, you need to apply some simple transformation that takes into account that "close" time series are those with highly positively or highly negative correlation. For example if you use some form of correlation rho, transforming it with: d=1 - abs(rho) or d=1 - rho^2 you could use them in a standard clustering algorithm.

Chapter about Hierarchical Clustering in Rob Hyndman book http://www.otexts.org/fpp/9/4

  • $\begingroup$ thank you, I have Rob's book, will have a look. In term so the Guisti & Batista paper it does not seem to be very relevant, because what I am looking for is understanding of the "distance" through substitution level (pure sales history) rather than using attributes of the product. If I am to use Euclidian distance to identify units of demand I will end up with Product Type / Product Category / Colour as ID of a cluster which is a good start, but not independent from the human input. Or did I get it wrong? $\endgroup$
    – Bulat
    Aug 3, 2015 at 23:27
  • $\begingroup$ You are getting it wrong. The idea is precisely to use the sales history to build the clusters. So items that follow the same sales patterns are clustered together. In that sense the paper is very relevant because sales are auto-correlated time series and not independent variables. For example sales the first week of December is highly correlated with sales on the 2nd week etc. You can combine sales history with product information like type/category/colour to build more meaningful clusters. $\endgroup$
    – Acoustesh
    Aug 4, 2015 at 0:42
  • $\begingroup$ I have updated my question with explanation of where I am getting from. $\endgroup$
    – Bulat
    Aug 4, 2015 at 0:55
  • $\begingroup$ Ok. Now I think I understand your problem. I updated the answer. $\endgroup$
    – Acoustesh
    Aug 4, 2015 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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