воскресенье, 30 августа 2015 г.

Sales forecasting with limits

Sales forecasting is an important part of modern business intelligence. In this area, it is important to analyze the reasons that cause time series behavior, e.g. trend. If we apply well-known technics without such analyzing, we can receive statistically correct results but from business point of view they will be incorrect. Examples of such incorrect results are predicted negative sales. Let us consider some sales time series, which map the consumptions of some goods. Suppose that the time series has a descending trend. This time series is shown below in the daily and weekly scale.






Seasonal fluctuations for daily sales with boxplot presentation  type are the following:



When we apply an approach based on the ARIMAX algorithm to this time series forecasting, we can receive negative values for predicted prices. This algorithm takes into account the multilevel seasonality (intra-week days, intra-month days, annual monthly seasonality). You can see the result   on the following figures


Time series considered in the daily scale. Green line denotes historical time series, red color denotes fitted time series, blue color denotes forecasted time series.
    Let us analyze the reasons which can cause the descending sales trend. One of the possible reasons is that  the vendor concentrates on the other product of the goods group and as a result, due to a higher price and lack of promotion  the consumers discontinue  purchasing the analyzed product. This reason can cause trend descending. But in the consumers’ structure, there is a group, which will purchase this product despite its higher price, lack of promotion and any other reasons. So, in the forecasting it is important to take into account the structure of consumers, which can be described by estimated sales minimum limit.   It can be considered using sales variable transformation. One of such ways is considered  by Rob Hyndman here. Using this variable transformation with minimum limit value for sales equal 50 and applying ARIMAX algorithm, we receive the following results (in the daily and weekly scales):



   So, using sales variable transformation with set sales limits, we can avoid incorrect results (e.g. negative sales)  for sales forecasting with descending trends.