Demand forecasting

On this page 7

Demand forecasting is the practice of estimating future customer demand for each product, location and time period, using historical sales, known events and external signals. In e-commerce inventory management, the forecast is the starting input for purchasing, safety stock and replenishment decisions: it determines how many units to order, when to order them and where to hold them.

A forecast is never exact. Its value lies in being less wrong than the alternatives and in quantifying uncertainty, so that a merchant can balance the cost of a stockout against the cost of excess and dead stock.

How demand forecasting works

A demand forecast decomposes past sales into underlying patterns and projects them forward. The main components are level (the current baseline rate of sales), trend (sustained growth or decline), seasonality (recurring patterns by week or year) and irregular effects such as promotions or outages.

An important subtlety is that recorded sales are not the same as demand. When an item is out of stock, sales drop to zero even though customers still want it. Good practice is to correct for censored demand by excluding or adjusting stockout periods, otherwise the model learns that demand is lower than it really is and perpetuates the shortage.

The table below summarizes the inputs most often used in online retail forecasting and what each one contributes.

InputExampleWhat it explains
Sales historyDaily units per SKU over two yearsBaseline level, trend and seasonality
Promotion calendarPlanned 20% discount weekShort-term uplift and post-promotion dip
Price changesPermanent price reductionShift in baseline through price elasticity
Traffic and conversionProduct page viewsEarly signal of rising interest
Holidays and eventsBlack Friday, school startRecurring peaks outside normal seasonality
Stock availabilityDays out of stockCorrection for lost, unrecorded demand
Common inputs to an e-commerce demand forecast

Forecasting methods and when they fit

Forecasting methods range from simple statistical rules to machine learning models trained across thousands of products. The right method depends on data volume, how regular the demand is and how much explanatory data is available, not on sophistication alone.

MethodHow it worksBest suited to
Moving averageAverages the last n periodsStable items with little trend
Exponential smoothingWeights recent periods more heavily, with optional trend and season termsEstablished SKUs with clear seasonality
ARIMA modelsModels autocorrelation in the time seriesLong, regular histories
Croston methodForecasts demand size and interval separatelyIntermittent, slow-moving items
Machine learningGradient boosting or neural networks with many featuresLarge catalogs with rich promotional data
Judgmental adjustmentPlanner overrides based on market knowledgeNew launches and one-off events
Main forecasting methods used in online retail

New products have no history at all. Forecasters handle them with analogous products (a similar item launched earlier), category-level curves or pre-order signals. Long-tail items that sell a few units a month are better handled by intermittent-demand methods than by standard models, which tend to forecast a misleading fractional unit every day.

Measuring forecast accuracy

Forecast accuracy is measured by comparing predictions with actual demand after the fact, and the choice of metric changes conclusions. No single metric is sufficient, so mature teams track accuracy together with bias, which shows whether forecasts are systematically too high or too low.

MetricWhat it measuresMain limitation
MAPEAverage absolute error as a percentage of actualsUndefined or extreme when actuals are near zero
WAPETotal absolute error divided by total actual volumeHides poor accuracy on small items
BiasAverage signed errorPositive and negative errors can cancel out
MASEError relative to a naive forecastLess intuitive for business users
Common forecast accuracy metrics

Accuracy also depends on the level of aggregation. A forecast for a whole category for a month is usually far more accurate than one for a single size and color for a single day. Typical SKU-level weekly errors in online retail range widely, from roughly 20% to over 50% WAPE, depending on catalog volatility, so targets should be set against a naive baseline rather than an abstract ideal.

From forecast to inventory decisions

A forecast becomes useful only when it drives replenishment parameters. The expected demand during supplier lead time sets the core of the reorder point, while the spread of forecast errors sets the safety stock needed to reach a chosen service level.

The following table shows how forecast outputs connect to neighboring inventory concepts.

Inventory decisionForecast input usedEffect of a poor forecast
Reorder pointExpected demand during lead timeOrders placed too late or too early
Safety stockForecast error variabilityToo little buffer or tied-up capital
Purchase quantityDemand over the coverage periodOverbuying or frequent small orders
Warehouse allocationDemand by regionSplit shipments and slower delivery
Inventory turnover targetAnnual demand per SKUUnrealistic turnover goals
How the demand forecast feeds inventory planning

Because purchasing commits money long before sales occur, probabilistic forecasts that give a range, such as the 50th and 90th percentile of demand, are more valuable than a single number. They let planners choose explicitly how much risk of stockout to accept for each product class.

Limitations and common mistakes

Demand forecasting fails most often through process and data problems, not through the choice of algorithm. Frequent mistakes include:

  • Training on sales instead of demand, which ignores lost sales during stockouts.
  • Ignoring promotions and price changes, so one-off spikes are mistaken for a new baseline.
  • Overriding statistical forecasts without tracking the result, which often adds bias rather than insight.
  • Forecasting at the wrong granularity, for example daily per size when purchasing is monthly per style.
  • Treating the forecast as a target, which mixes sales ambitions with neutral estimates.

External shocks such as supply disruptions, viral social media attention or sudden competitor price cuts remain fundamentally hard to predict. In these cases, short review cycles and fast replanning matter more than a better model.

Understanding it simply

Demand forecasting is an educated guess about how much customers will buy in the coming weeks or months. A shop looks at what sold before, notes what is coming up, such as holidays or sales, and estimates how many of each product it will need.

It works much like planning food for a party. Knowing how many guests came last year and whether more are invited this time helps buy the right amount. Buy too little and people go hungry; buy too much and food goes to waste. The goal is not perfection but fewer costly surprises.

Applied in practice

An online store selling outdoor equipment carries about 4,000 SKUs and buys from suppliers with lead times of six to ten weeks. Before each autumn season, the planning team generates weekly forecasts per SKU using exponential smoothing with yearly seasonality, adjusted for a planned discount campaign in October and corrected for weeks when items were out of stock last year.

For rain jackets, the forecast shows demand rising roughly threefold from August to October. The team uses the 90th percentile of the forecast for its best sellers and the median for slow movers, which sets safety stock accordingly. At the end of the season, stockouts on top sellers fall noticeably compared with the previous year, while leftover stock stays within the clearance budget, freeing cash for the winter range.