Empty Shelves and Excess Stock

Ordering the right quantity of each product for each store, so the shelf is not empty when customers arrive and the backroom is not full of stock that ends in a markdown.

AI is suitable with conditions

Forecasting demand across tens of thousands of products and hundreds of stores is a genuine fit for statistical forecasting and machine learning, and pooled models that learn across many products won the M5 competition, the largest public retail forecasting benchmark. It is conditional rather than strong because the forecast is often not the only thing failing. An audit of one retailer's stores found nearly two thirds of inventory records inaccurate, and studies attribute a large share of empty shelves to store-level ordering and shelf replenishment rather than to upstream supply. A better model fed a stockout-suppressed sales history and a perpetual inventory that believes the shelf is full will place the same wrong orders with more confidence. The value of AI therefore depends on first correcting the demand history for stockouts and catching inventory records that no longer match the store.

Problem Statement

Every week a retailer has to decide how much of each product to send to each store.

Send too little and the shelf is empty when a customer comes looking, and send too much and the excess sits in the backroom until it is marked down or thrown away.

The decision looks like a forecasting problem, and the market for forecasting tools treats it as one.

The sources behind this playbook point at the data as often as at the model: a sales history that hides stockouts, and an inventory record that does not match the shelf.

Business Context

The scale is what makes this function distinctive.

A grocery or general merchandise chain can have tens of thousands of products across hundreds of stores, and that means millions of product and store combinations, each of which needs an order quantity on every delivery cycle.

Nobody can review those by hand, so the replenishment system places most orders automatically and planners intervene on the exceptions.

That makes the parameters and the inputs of the system, not the individual orders, the real place where planning decisions are made.

It also means a small systematic error, such as one that slightly under-orders every product that ran out last month, compounds across the whole chain.

Why This Is Hard

The first difficulty is that sales are not demand.

When a product is out of stock, sales for that day drop to zero or near zero, and the history records low demand rather than missing supply.

A forecast trained on that history orders less, which makes the next stockout more likely, which teaches the forecast that demand is even lower.

Practitioners correct for this by flagging stockout periods and either replacing their sales with an estimate of what would have sold, or treating them as censored observations that show demand was at least the recorded sales, as one independent practitioner demonstrates with a censored likelihood model.

The estimate only ever replaces a lower recorded figure, because a stockout can hide demand but cannot add to it.

The second difficulty is that the inventory record is not the inventory.

An audit of nearly 370,000 inventory records across 37 stores of one retailer found nearly two thirds inaccurate, through causes such as theft, damage, miscounted deliveries, and misplaced stock.

When the record says stock is present and the shelf is empty, the system never reorders, and the product can sit at zero sales for weeks while the system believes it is simply not selling.

The third difficulty is sparsity.

Most products in most stores sell a handful of units a week or less, so a single product and store history is mostly zeros.

Forecasting: Principles and Practice notes that percentage error metrics are undefined when sales are zero and that standard methods assume continuous data, which is why forecasters aggregate to a grouped level and spread the result down, use methods built for intermittent demand such as Croston’s, or use pooled models that learn across many series at once.

The last difficulty is that the forecast is the wrong output.

A replenishment order has to cover uncertain demand over the lead time, so what it needs is a range, such as the quantity that covers demand nineteen times out of twenty, and an average does not provide one.

How The Solutions Fit Together

Reorder-point rules are the floor.

They turn a forecast and a service level target into an order quantity in a way every planner and store manager can check, and they remain the mechanism that places orders even when a model supplies the inputs.

A stockout-corrected statistical forecast supplies those inputs for the whole range, after the sales history has been cleaned of stockout periods.

It is fast, it is explainable component by component, and it is the benchmark that any more complex model has to beat.

Phantom inventory screening runs beside both, looking for products whose sales have stopped in a way their demand history does not explain, and sending a store worker to check the shelf.

It addresses a cause the other solutions cannot see, the empty shelf whose record says it is full, and research has shown products missing from the shelf can be detected from sales data with useful accuracy.

A pooled demand model with quantile output supports the statistical forecast where it is measurably weak, typically on promotions, new products, and the slowest sellers, by learning from many similar products and stores at once.

None of these decides on its own.

Each changes the numbers a planner sees and the orders the system proposes, and the planner remains responsible for service levels, promotions, and overrides.

Implementation Considerations

Measure on-shelf availability physically before changing anything, with shelf audits or gap scans on a sample of stores, because the system’s own in-stock figure will flatter the starting point.

Build the stockout flag and the corrected demand history first, since every later step depends on it.

Benchmark every forecast against a seasonal naive forecast and exponential smoothing, on corrected demand, with a scaled error metric rather than MAPE.

Run the comparison as a backtest over several past periods, never a single holdout, because seasonal retail series can look good or bad on one period by chance.

Set order quantities from a demand quantile chosen by the planner’s service level target, and let the planner change that target by category rather than editing orders one at a time.

Log every planner override with the reason, so their effect can be measured instead of debated.

ROI Considerations

The return comes from three places, and they have to be counted together.

Recovered sales from shelves that are no longer empty, much of which comes from correcting phantom inventory and stockout-suppressed history rather than from a better model.

Lower markdowns, waste, and working capital from stock that no longer needs to be held as a cushion against an untrusted forecast.

Planner time recovered from routine overrides and redirected to promotions, launches, and the exceptions that actually need judgement.

A project that raises availability by inflating stock everywhere has moved cost from lost sales to markdowns and has not produced a return.

Security, Privacy, and Regulation

Sales, stock, and inventory data are not personal data, but cost prices, supplier terms, and promotion plans are commercially sensitive and should be limited to the functions that need them.

Loyalty and basket data are personal data, so use them only in aggregated form for substitution analysis, and only within the purposes customers were told about.

Phantom inventory flags can point towards theft in a particular store, so keep them operational and route any loss prevention investigation through the retailer’s existing process rather than treating a flag as evidence about an individual.

Where The Evidence Disagrees

The sources do not settle which forecasting model to start with.

Forecasting: Principles and Practice presents exponential smoothing as producing reliable forecasts quickly for a wide range of series, which makes it the usual fast default per product, while pooled models that learn across products won the M5 competition on several years of daily sales from a single large chain.

No source here says exactly where one approach stops beating the other on a given retailer’s data.

This playbook’s choice, which is a judgement rather than a sourced finding, is to make the statistical forecast the default because it is cheap and explainable, and to make the pooled model earn its place category by category in a backtest.

Published estimates of how much of the out-of-stock problem starts in the store, rather than further up the supply chain, also vary widely between studies and summaries of them.

All of them put a substantial share in the store, so this playbook states it qualitatively rather than quoting a single figure.

Symptoms

Root causes

Business impact

Traditional approaches

Solution approaches

Each of these is written for this problem specifically, not borrowed from a generic catalogue.

Recommendation

Start with explicit reorder-point rules and a stockout-corrected statistical forecast for every product and store, because these are cheap, explainable, and the benchmark anything more complex must beat. Run phantom inventory screening alongside them from the start, since it finds the empty shelves that no forecast will ever reorder. Add a pooled demand model with quantile output only where the statistical forecast is measurably weak, typically on promotions, new products, and very slow sellers, and set order quantities from the quantiles rather than a point forecast. Planners keep control of promotions, new product launches, and the service level targets, and store staff confirm a phantom inventory flag on the shelf before any record is corrected.

Data requirements

Point of sale history medium sensitivity
Units sold per product, store, and day or week, with price paid, used as the demand signal once corrected for stockouts.
Perpetual inventory and stockout flags low sensitivity
Daily on-hand quantity per product and store, plus any recorded out-of-stock events, needed to tell low demand apart from no stock.
Receipts, transfers, and adjustments low sensitivity
Deliveries received, inter-store transfers, write-offs, and count adjustments, used to explain why records and physical stock diverge.
Promotion and price calendar medium sensitivity
Planned and past promotions, price changes, display placements, and flyer features per product and store.
Product and store master data low sensitivity
Product hierarchy, case pack, shelf capacity, shelf life, store cluster, and delivery schedule, used to group sparse series and to turn a forecast into a feasible order.
Loyalty or basket data high sensitivity
Optional customer-level purchases that show substitution when a product is missing. Personal data, so use only aggregated where possible.

Evaluation metrics

Human oversight

Planners own service level targets, promotion and launch forecasts, and the decision to override an order, and every override is logged so its effect can be measured. Store staff confirm a phantom inventory flag on the shelf before the record is corrected. No model changes a service level target, cancels a supplier order, or writes off stock on its own.

Common pitfalls

When not to use AI

Sources

Practitioners

Research

Agent context

A distilled brief for an AI agent or an engineer scoping this work. It carries the constraints and pitfalls that change an implementation decision, not the whole page.

Get the agent context as Markdown

Objective

Produce stockout-corrected demand forecasts and order quantities per product and store that raise measured on-shelf availability without increasing markdowns, waste, or days of supply, and surface inventory records that no longer match the shelf.

Constraints

Inputs

Outputs

Success criteria

Last updated 2026-10-01