Yesterday's sales can hide the demand you could not serve
For IT heads, operations directors and digital project owners · Compare approaches
TL;DR — what you’ll learn
- Treat recorded sales and underlying demand as different quantities.
- Mark stockouts and other availability restrictions before training or evaluating a model.
- Backtest using only information available at each historical planning date.
- Compare forecast error, bias and inventory consequences against a simple baseline.

A popular item sells out by lunchtime. The next forecast sees only the units sold and reduces the following order because sales were lower than usual. The model has learned from the record correctly; the record did not represent the question the planner wanted answered.
How should food demand forecasting account for stockouts?
A food demand forecast should account for periods when sales were constrained by availability. Otherwise the model can learn that a stockout means lower demand and recommend too little stock again. Keep observed sales, availability evidence and any estimated lost demand separate, then evaluate the forecast at the horizon the business actually plans.
- 01Prepare the historySales and availability evidence
- 02Backtest at the cut-offSame horizon and available inputs
- 03Compare with a baselineError, bias and operating consequencesDoes the model improve the relevant decision?YesReview the proposalNoRetain the baseline and investigate the failed segments.
- 04Review the proposalKeep order constraints separate
Illustrative information flow. The article explains the evidence, exceptions and responsible decisions. Diagram: NextEdge Labs.
Build an availability-aware history
Collect sales at the relevant product, location and time level, then add evidence of stockouts, delisting, closures, cancellations and other restrictions. A zero can mean no demand, no stock, no trading or missing data. Those states should not be collapsed into one numerical observation without review.
Keep estimates separate from observations. If the business estimates lost demand during an unavailable period, retain the method, assumptions and uncertainty. Do not silently replace the original sales record with an invented true-demand number. The planner needs to know which parts of the history are measured and which are modelled.
Match the forecast to the decision horizon
A kitchen ordering for tomorrow needs a different horizon from a manufacturer buying a long-lead ingredient. Define when the decision is made, what it commits and when the product becomes available. Forecast evaluation should use that lead time and aggregation level.
For an illustrative next-day replenishment process, use the data that would have been available before the previous day's cut-off. Do not include the next morning's orders when testing a model that must run the night before. A good historical fit can be unusable if it depends on information that arrives after the purchasing decision.
Use a baseline that deserves to be beaten
Compare the proposed approach with a simple rule that the business could operate, such as an appropriate recent-history or seasonal baseline. Keep the comparison on the same dates, products and available inputs. Complex models should earn their maintenance cost through a meaningful improvement on the actual decision.
Forecasting: Principles and Practice describes time-series cross-validation using successive historical forecast origins. This is a useful foundation for testing without leaking future observations into the model. The food-specific implementation still needs the correct availability flags, horizon and operating constraints.
Source: Forecasting: Principles and Practice · Time-series cross-validation and rolling forecast origins. Reference details
Read error and bias together
Suppose an illustrative item has actual unconstrained demand of 100 units on each of two days. Forecasts of eighty and 120 have zero average signed error, but both days have an absolute error of twenty units. A balanced bias measure alone would conceal the operational mismatch.
Review systematic over- or under-forecasting alongside absolute error and the consequences of the resulting decisions. For perishables, over-ordering and under-ordering can have different costs. Use the business's own waste, service and margin evidence when comparing policies; do not invent a universal cost ratio.
| Day | Demand | Forecast | Forecast minus demand |
|---|---|---|---|
| 1 | 100 | 80 | −20 |
| 2 | 100 | 120 | +20 |
| Average | 100 | 100 | 0 signed error; 20 absolute error |
Keep the forecast separate from the order
The order proposal also depends on eligible stock, incoming supply, lead time, pack multiples and usable life. A forecast of demand is not itself a purchase quantity. Preserve those calculation steps so the planner can see whether excess came from the forecast or from a supplier minimum.
Start in a review mode for a bounded product and location group. Record the model proposal, planner override and reason, then compare outcomes. An override can contain valuable information, but it should not automatically be treated as correct or used as an unexplained training target.
A software evaluation should show the unavailable periods, baseline comparison and failed cases. If a supplier presents only an accuracy percentage, ask which horizon, denominator and stockout treatment produced it. Those answers determine whether the result is relevant to the business.
Summary
Reliable demand forecasting begins with a history that distinguishes demand from the ability to sell. Evaluate at the real planning horizon, compare against a practical baseline and inspect both bias and error. Keep the forecast separate from the replenishment decision and its inventory constraints.
What to do next
- Mark stockout and closure periods in one product-location history.
- Backtest a simple baseline and the proposed model at the actual order cut-off.
- Compare service and waste consequences before allowing automated order creation.
Compare this workflow with your current setup
Share the step that takes the most manual work, the systems involved and the exceptions your team handles. That gives us a concrete starting point for comparing approaches.
Sources and further reading
Sources checked 15 October 2026. The worked examples and software evaluation suggestions are NextEdge Labs’ editorial analysis.
- Time series cross-validationForecasting: Principles and Practice · Third edition, online chapter 5.10
Reference for evaluating forecasts using observations available before the forecast origin.
Visual credits
AI-generated illustration created for NextEdge Labs; it does not depict a client facility. Workflow diagram by NextEdge Labs. Icons from Lucide (ISC licence).
