Why zeroes happen

Anna Sroginis and I have been working on a new approach for intermittent demand classification over the past year. We’ve taken a fresh look at the problem, starting by asking: why do zeroes happen? Let’s discuss why indeed.

First, a quick note: it’s a mistake to define intermittent demand simply as “demand with zeroes”. That definition is incomplete and can be misleading. As some of you know, the definition I prefer is that intermittent demand occurs at irregular frequencies. This means the zeroes in such demand are unpredictable and happen simply because nobody wanted to buy the product on a specific day. Unless you know precisely who will buy and how much, you can’t predict if there will be demand that day. These zeroes can be considered “naturally occurring”.

But zeroes can also happen for other reasons. People might want to buy a product, but it may be unavailable. This typically happens due to stockouts, caused by either incorrect safety stock levels, supply chain disruptions (e.g., a container ship running aground), or a product being discontinued by the company. Sometimes, zero sales occur because a store was closed for a holiday, a gas leak, a flood, or another unexpected event. These types of zeroes are explainable and sometimes even predictable, so we can call them “artificially occurring”.

Furthermore, zeroes may appear at the start of a time series if a product was recently introduced and lacks a sales history. These zeroes don’t provide useful information for forecasting.

Some zeroes might also occur seasonally, for example, for Christmas-related products. These too can be classified as artificially occurring because, while there may be a small demand for such items, it’s usually unreasonable to sell them just to satisfy a handful of customers.

Finally, errors in the system can result in zeroes. For example, sales might not have been recorded correctly, leading to either zeroes or missing values (sometimes treated as zeroes). These can also be categorized as “artificially occurring”.

Demand with only artificially occurring zeroes isn’t intermittent; it is regular demand with issues.

Having said that, the reality is often more complex. You can easily have intermittent demand with stockouts, and distinguishing between naturally and artificially occurring zeroes in such cases can be challenging.

But why bother?

If your goal is to forecast demand (not just sales), you need to address artificially occurring zeroes in your data. When applying models, you should indicate which observations should either be ignored or treated differently. Similarly, when measuring the performance of your models (e.g., forecasting accuracy), you should evaluate them on data without artificially occurring zeroes. Otherwise, you’ll end up testing which model forecasts stockouts or system failures better, rather than actual demand. This ties into the well-known principle: “You should forecast demand, not sales”. In the case of intermittent demand, this is not only difficult but also extremely important.

Here’s an example of a time series N27364 from the M5 competition (Makridakis et al., 2022):

Series N27364 from the M5 dataset

Series N27364 from the M5 dataset

This isn’t a unique case, most time series in the M5 dataset have stockouts. In this specific example, gaps in sales are apparent and likely caused artificially. If we train a model on this data, it might those zeroes into account and produce inaccurate demand forecasts, e.g. lower point forecasts than necessary. The problem worsens if the test set also contains stockouts, as the selected model would be the one that forecasts artificially occurring zeroes better. Using such a model in decision-making could be harmful, leading to erroneous decisions like discontinuing products that actually sell well.

As a final note, Stephan Kolassa has given excellent presentations on the challenges of forecasting in retail. He has shared insightful examples of the complexities of tracking sales and stock. For instance, he discussed this topic in one of the CMAF webinars and in this short video.

Leave a Reply