Library · Demand and stock

Poisson or negative binomial demand

A count distribution turns a mean forecast into stock levels. The Poisson distribution assumes the variance equals the mean. When orders come in batches the variance is larger, and the negative binomial fits better.

By , published

Definition

The Poisson distribution has one parameter, its mean μ, and its variance is also μ. The negative binomial has a second parameter that lets the variance exceed the mean:

Poisson: Var = μ    negative binomial: Var = μ + μ² ÷ r

The ratio of the variance to the mean is a first diagnostic. Near 1, a Poisson distribution is plausible. Well above 1, the data show overdispersion and Poisson quantiles are too low. Snyder, Ord and Beaumont found the negative binomial preferable to the Poisson on slow-moving car parts.

Worked example

Customers arrive at random and each orders a variable number of units. Both distributions are fitted by matching moments on a training sample, and their 95 % quantile is checked on new data.

import numpy as np
from scipy import stats

rng = np.random.default_rng(14)

def draw(n):
    orders = rng.poisson(1.5, n)                               # customers per period
    return np.array([rng.geometric(0.4, k).sum() for k in orders])   # units per customer: 1, 2, 3...

train, test = draw(500), draw(100_000)
m, v = train.mean(), train.var(ddof=1)
print(f"mean = {m:.2f}   variance = {v:.2f}   variance / mean = {v / m:.2f}")

q_pois = stats.poisson.ppf(0.95, m)
r = m * m / (v - m)
q_nb = stats.nbinom.ppf(0.95, r, r / (r + m))
for name, q in [("Poisson", q_pois), ("negative binomial", q_nb)]:
    print(f"{name:18s} 95 % quantile = {q:.0f}   share of new periods covered = {np.mean(test <= q):.3f}")

Output, produced by running the code above when this page was built:

mean = 3.84   variance = 14.78   variance / mean = 3.84
Poisson            95 % quantile = 7   share of new periods covered = 0.849
negative binomial  95 % quantile = 11   share of new periods covered = 0.951

The variance is several times the mean. The Poisson quantile covers fewer periods than the 95 % it was built for; the negative binomial quantile is higher and closer to the target.

Where it misleads

  • On a short history the variance is poorly estimated, and the fitted variance can even fall below the mean, where the negative binomial does not exist. A fallback to the Poisson has to be written in the code and counted in the report.
  • Neither distribution has enough zeros for some items. Zero-inflated and hurdle variants add a separate probability of no demand.
  • A good fit on the bulk of the data does not guarantee the tail. The quantile used for stock should be scored on data held out, with the pinball loss and coverage.

The choice of distribution matters less than the quality of the mean it is centred on. A well-chosen distribution placed on a biased mean gives a biased quantile.

In our work

We test the distribution and the mean forecast separately. In our study on 2,404 spare-part series, changing the point forecast under a Poisson quantile moved the quantile loss more than changing the distribution did.

References

  1. Snyder, R. D., Ord, J. K., Beaumont, A. (2012). Forecasting the intermittent demand for slow-moving inventories: a modelling approach. International Journal of Forecasting, 28(2), 485-496. doi:10.1016/j.ijforecast.2011.03.009
  2. Kolassa, S. (2016). Evaluating predictive count data distributions in retail sales forecasting. International Journal of Forecasting, 32(3), 788-803. doi:10.1016/j.ijforecast.2015.12.004
  3. Agrawal, N., Smith, S. A. (1996). Estimating negative binomial demand for retail inventory management with unobservable lost sales. Naval Research Logistics, 43(6), 839-861. doi:10.1002/(SICI)1520-6750(199609)43:6<839::AID-NAV4>3.0.CO;2-5

Have a question like this one on your own data? Tell us what you need in a few lines.

Send us the brief

Related pages

  • Pinball loss (quantile loss)The pinball loss, or quantile loss, is the measure for a quantile forecast, such as the stock level that covers demand 90 % of the time. It is minimised by the true quantile and by nothing else.
  • Safety stock and the normal approximationSafety stock is the stock held above the expected demand over the lead time. The textbook formula assumes that this demand is normally distributed. For slow items it is not, and the service obtained differs from the target.
  • Lead-time demand and its bootstrapWhat a reorder point must cover is the total demand between placing an order and receiving it. Its distribution can be estimated by resampling the history, without assuming a shape.
All library pages