How to Forecast Demand When Stockouts Hide Actual Sales

how to series
Updated: Nov 24, 2026
How to Forecast Demand When Stockouts Hide Actual Sales

Take a store that sells 12 snack bars a day. One afternoon they sell out early, and the shelf stays empty for five more days. Averaged over the last 28 days, the sales record now says 9.6 units a day. The forecast believes it, the order shrinks, and the shelf can go empty again by the weekend.

To forecast demand when stockouts hide actual sales, treat stockout days as missing data, not as zero demand. Build the baseline from clean days, when the item was available all day. Keep the sales you observed, estimate only the demand you missed, and backtest the corrected history against the raw one. Shoppers did not change. Only the record did.

Stockouts write zeros into your sales history

A full day out of stock records zero sales even if shoppers came for the item. Sales data captures what people bought, not what they wanted. Forecasters call the gap censored demand.

Most forecasting methods read history as truth, so a week of zeros looks like a week of weak demand. The baseline drops, the next order shrinks, and the next stockout arrives sooner. The forecast learns the shortage. Then it repeats it.

On Monday morning, a planner sees a weak week for the item and trims the order. Nobody checks why the week was weak.

How a stockout lowers the next forecast and order

Researchers at Dingdong, a Chinese fresh-grocery chain, measured that loop on 50,000 fresh-product sales series from 898 stores. In one benchmark test, forecasts built on raw sales ran 7.4% below actuals. After the team rebuilt the demand hidden by stockouts, the bias shrank to a slight overestimate: 2.6% with this setup, 0.6% with another recovery method. Weighted forecast error fell by 2.7 percentage points with the first setup and 2.5 with the second.

Profitero's 2026 survey of 1,000 US shoppers shows where that missing demand goes. Facing an empty shelf, 36% bought a similar product from another brand in the same store, and 33% stuck with the same brand. Picture 100 shoppers reaching the empty snack-bar slot. About 36 of them land in a neighbor's sales history, so the substitute looks stronger than it is. The empty slot records none of them. Stated intentions are not receipts, but the direction is clear: a stockout moves demand around as well as hiding it. 

Daily stock and sales records miss partial-day and phantom stockouts

Closing stock of zero is only a signal, and an imperfect one. An item that sold its last unit a minute before closing shows zero stock after a full day of sales. The harder cases slip past a zero-stock rule.

The partial-day stockout hides in plain sight. The item sells out at 2 p.m., so the day shows sales and looks normal. The evening shoppers are gone from the data. Dingdong's dataset tracks stockouts by hour, so researchers can separate a partial-day stockout from a full day without stock.

Phantom stock works the other way. The system says 8 units are on hand, the shelf is empty, and sales read zero. No stockout flag fires, because the record says there is stock.

Substitution is not a stockout but a side effect of one. Shoppers who cannot find your item buy the one next to it. Your item looks weaker than it is, and the substitute looks stronger.

Preventing empty shelves is a separate job, covered in our guide to out-of-stock situations in retail. Here the shelf is already empty, and the question is what that does to next week's forecast.

Six steps rebuild the demand that stockouts hide

A clean forecast after a stockout needs six steps, and the first one is about data, not models. Skip it and every later step guesses.

Step 1: Store stock and sales at the same level

Daily closing stock for every SKU in every store is the minimum input for finding stockout days. Keep it next to daily sales, in the same table. If your POS or ERP records the time of the last sale, keep that too. In many chains this data already exists. It just lives in two separate reports.

Store level matters more than it seems. A chain total can look healthy while ten stores sit empty. Averages hide stockouts well.

Step 2: Flag every day that is not clean demand

A confirmed stockout day is one when shoppers could not buy the item. Opening stock was zero and no delivery arrived, or a store count found the shelf empty. Everything else is a signal to check, not a fact.

Zero sales while the system shows stock, on an item that normally sells every day, make a phantom stock suspect. A sharp drop in sales once stock falls below a few units suggests the shelf emptied before the record did. An early last sale is a third clue, not proof: it can mean an empty shelf or just a quiet afternoon. Check each signal against a store count or the next delivery before you exclude the day. Promo days, bulk orders and one-off events get their own flag. They are not stockouts, but they bend the baseline in the other direction.

In the snack bar example, days 15 to 19 are confirmed: opening stock was zero and no truck came. Day 14 started as a signal. The last sale came at the hour by which the item usually makes half its daily sales, and the shelf was empty the next morning. A shelf check confirmed it sold out then and stayed unavailable until closing.

Step 3: Build the baseline from clean days only

Average daily demand comes only from clean days, when the item was on the shelf all day. Stockout days stay out, and so do days flagged for promotions, bulk orders or one-off events. In the example, that leaves 22 clean days out of 28.

For fast movers, this one step removes most of the damage. It needs no model, though the clean-day average is still an estimate. Check that clean days cover the same demand patterns as stockout days. If the item regularly sells out on Saturdays, weekday sales will understate Saturday demand.

Step 4: Estimate lost sales from comparable clean days

Excluding days fixes the baseline and leaves holes everywhere else. Weekly patterns, seasonality and lost sales reporting all need a full daily series.

Use the closest clean reference you have. If the item sold 14 units on each of the last three Saturdays, a stockout Saturday probably had similar demand. Stores from the same cluster that had stock that day show what the market wanted. For a partial-day stockout, confirm when the item ran out, keep the units you actually sold and estimate only the missing part. Scale by the share of the SKU's daily sales that usually happens by that hour on clean days. Store traffic works as a proxy only if it follows the same intraday pattern. Evenings are often busier.

Pick a reference period that matches the stockout period in everything except stock. A promotion, a holiday, a price change or a seasonal turn breaks the comparison. The estimate will never be exact. It only has to beat the raw history in the Step 6 backtest.

Step 5: Correct the substitutes too

A substitute that gained sales during the stockout may carry borrowed demand in its history. When the snack bar is gone, the granola bar next to it has a good week, and part of that week may belong to your item. But a promotion, a price change or a busy week can explain the same gain, so check those first. Then compare the substitute's sales with clean days when both items were on the shelf. Lower its history by the amount of demand that shifted, and only when the comparison supports an estimate. Expect a mix: some real substitution, some coincidence. Skip the check, and you either overforecast the substitute or cut its own demand.

Keep raw sales and corrected history side by side, with every estimate flagged. Planners need to see which numbers were sold and which were inferred. Managing close substitutes as one group, as our article on substitutable SKU management explains, keeps this from turning into a weekly chore.

Step 6: Backtest before you trust the correction

A correction is a hypothesis until a backtest confirms it. Forecast a past period twice, once from raw history and once from corrected history. Use the same model, forecast dates and horizon for both runs, so the history is the only change. Then compare both against actual sales on clean days. Use only the data that existed on each forecast date: a backtest that peeks at later sales flatters any method.

Two numbers decide. Forecast error should fall. Bias should move toward zero, because censored history pushes forecasts low on average. If error rises, check the size of your lost sales estimates, the stockout flags and the clean days you picked as references. Our guide to forecast accuracy in retail covers which error metrics to use.

Stockouts cut the snack bar forecast by about 20%

The snack bar from the opening sells about 12 units on a normal day in one store. Here are its last 28 days.

Period Days Units sold Stock status
Clean days 22 264 On the shelf all day
Day 14 1 6 Sold out after half its usual daily sales
Days 15 to 19 5 0 Out of stock
Total 28 270

The raw average is 270 units over 28 days, or 9.6 units a day. The clean baseline is 264 units over 22 clean days, or 12.0 units a day. On clean days, the snack bar makes half its daily sales by the hour it sold out on Day 14. With 6 units sold by then, the estimate is 6 missed sales. Days 15 to 19 lost about 60. So estimated demand was about 336 units, and the register recorded roughly 20% less.

Now follow the replenishment math. With weekly orders and a two-day lead time, the store plans for 9 days of demand. Safety stock comes on top. Stock on hand and open orders due within those nine days come off, and what remains is the order quantity.

History used Daily demand used 9-day demand before safety stock
Raw history 9.6 87 units
Corrected history 12.0 108 units

The raw figure uses the unrounded average: 270 ÷ 28 × 9 is about 86.8 units, which rounds to 87. The raw history puts nine-day demand 21 units lower, almost two days of sales. Whether that gap empties the shelf depends on stock on hand and the next delivery date.

One detail completes the model. During days 15 to 19, a similar SKU on the same shelf sold 4 extra units a day. Treat those 20 units as possible substitution and run the Step 5 check before you adjust anything.

LEAFIO AI corrects stockout days before it forecasts demand

LEAFIO Inventory Optimization builds its forecast with machine learning models that read sales history, promotions, seasonality and external factors such as weather. Before the model learns from that history, stockout days are handled so they cannot pass for weak demand. Depending on how fast an item sells, a stockout day is either corrected toward real demand or left out of the history.

Promotions, wholesale orders and other unusual days stay out of the baseline too, so one bulk order does not inflate next month's orders. Planners can also mark days they know were unusual, such as a local event, and the forecast leaves them out. Our demand planning page covers the forecast in more detail.

How to forecast demand when stockouts hide actual sales: recorded sales vs. real demand

The module also flags items that usually sell but show stock and no sales for several days, a common sign of phantom stock. A store can then check the shelf before the gap reaches the forecast.

Toy House, a 67-store toy retailer in Eastern Europe with more than 50,000 SKUs, cut lost sales by 26% with LEAFIO AI. SKU availability reached 98%. Those results came over four years. They cover the whole move from Excel ordering to automated replenishment, now run by two planners. Stockout correction is one part of that change, not its sole cause.

KOLO, a convenience chain with more than 236 stores, reduced lost sales by 13% and overstock by 43% with LEAFIO AI. Both figures reflect the whole inventory project, not stockout correction alone. Track lost sales and overstock together whenever you change how you estimate demand.

Slow movers, phantom stock and promo days need a different approach

Stockout correction works best for items that sell every day with a regular pattern. Outside that zone, it needs a lighter hand. Sometimes it should not run at all.

Slow movers break the method first. When an item sells twice a week, one estimated day can swing the baseline hard. Correct them cautiously, or forecast them from similar items. An item that is out of stock more often than in stock has too little clean history, so fix its supply first.

Stock records are a harder problem, because a stockout you cannot see is a stockout you cannot correct. A 2026 study in the Journal of Business Logistics tracked about 24,000 SKUs in 11 stores of a UK grocery chain. In its field test, the researchers compared an audited store with a control store and estimated an 11% sales lift from the audit. The lift came from items where the system showed more stock than the shelf held. Fixing the records let replenishment restart on those items. Sales patterns can flag records worth checking. Only counting confirms them.

Promotions need their own logic. A stockout during a promotion hides promo demand, not normal demand. Filling it with the baseline rate understates it. Estimate those days with promo logic instead, as our trade promotion optimization guide describes.

One mistake undoes good corrections: replacing zeros with last month's forecast. A forecast built on a forecast passes its old error forward as history.

And no correction replaces stock on the shelf. Better on-shelf availability means fewer stockout days to estimate in the first place.

A stockout is a gap in the record, not a drop in demand. Forecast from the days the shelf was full, and the next order starts from real demand instead of the gap.

Is your forecast still reading stockout days as weak demand?

Request a demo of LEAFIO Inventory Optimization to see how it builds the baseline after a stockout

Is your forecast still reading stockout days as weak demand?

FAQ

Should I remove stockout days or fill them with estimates?

Removing stockout days is usually enough for the baseline, and it carries less risk. Filling them helps when you need full daily series for seasonality, weekly patterns or lost sales reporting. Flag every estimate. Planners must tell inferred numbers from real sales.

How do I estimate lost sales when an item runs out mid-day?

Confirm when the item sold out: the time of the last sale alone is not enough. Then check what share of the SKU's daily sales usually happens by that hour on clean days. If the share is about half and the store sold 6 units, estimate about 6 missed sales.

Does correcting for stockouts increase overstock risk?

Stockout correction raises overstock risk when estimates run high, demand shifts, or open orders already cover the expected demand. Estimate lost sales from clean days, adjust substitutes only where the comparison supports it, and backtest the result. A good correction lowers bias. Forecast error stays flat or falls.

Does LEAFIO remove stockout days from sales history?

Yes, but it does not simply delete them. Depending on how fast an item sells, a stockout day is either corrected toward real demand or left out of the history, so empty shelves do not pull the forecast down. 

Have a question? Have a question?

Have a question?

Have inquiries about retail automation or optimization? Talk to our expert for solutions!
Kristi Miller

Kristi Miller

Retail optimization expert

Share this article
Stay informed - Sign up for our newsletter!

Join our mailing list to receive a monthly digest of our most valuable resources.