Demand forecasting: smoothing, seasonal indices, analogs and error control
Sales forecasting mathematics for the purchase plan and replenishment: moving average, exponential smoothing, seasonal indices, new-item forecasts by analogs and error metrics (WAPE, MAPE, bias, tracking signal). It decides which method to use at which horizon, and when to stop trusting a forecast and revisit the purchase.
Why this document
The planner and the commercial director read this when a forecast drives purchasing, and purchasing is cash frozen in stock. It matters because each method has its domain: a moving average lags the season, seasonal indices catch it but fail on new items, where analogs are needed. Error metrics show which method to trust, and the tracking signal catches systematic over- or under-forecasting before the warehouse shows it. Without error control, a forecast stays an opinion.
At a glance
- What is this document and why is it needed?
- Sales forecasting mathematics for the purchase plan and replenishment: moving average, exponential smoothing, seasonal indices, new-item forecasts by analogs and error metrics (WAPE, MAPE, bias, tracking signal). It decides which method to use at which horizon, and when to stop trusting a forecast and revisit the purchase.
- Who owns the document and how often is it rebuilt?
- Demand analyst or purchase planner; recalculated weekly (replenishment) and monthly (season plan); approved at S&OP and fed into OTB, orders and the budget.
- What mistakes are the most common?
- Sales rather than demand are forecast → scarce items are underestimated and ordered short → reconstruct demand on out-of-stock days. The method is chosen by MAPE on small SKUs → items with near-zero sales decide the result → evaluate by WAPE and by groups. α and indices are fitted on the whole series and tested on it → false accuracy → a hold-out window excluded from tuning.
For whom
- Brand
- A brand forecasts demand in two layers: partner sell-out and own channels. Production orders are placed 4-9 months ahead, so the main horizon is seasonal and weekly accuracy is secondary; error is measured at model and color level, not size.
- Retail
- A retailer forecasts by store and category weekly for replenishment and by season for purchasing. New items without history are forecast by analogs; error drives shelf gaps and leftovers, so bias matters more than MAPE.
What it consists of
What a forecast consists of
- Level (base volume), trend (slow rise or fall), seasonality (a repeating monthly and weekly pattern), events (promotions, holidays, weather) and random noise; a good method separates these parts rather than fitting one line.
- Demand is forecast, not sales: sales under stock-outs are understated (censored demand); out-of-stock days are excluded or reconstructed from the size-curve share.
Methods in order of complexity
- Naive (last value) and seasonal naive (same period last year) serve as the benchmark: any complex method must beat them.
- A moving average over k periods smooths noise but lags a trend and knows nothing of seasonality; exponential smoothing L_t = α·y_t + (1 − α)·L_(t−1) weights fresh data more; in the example the best α on the first 24 months is 0.9 (the series is noisy with level shifts).
- Seasonal indices: for each month take the ratio to the year average, average over years and normalize so the indices average 1; forecast = smoothed level of the deseasonalized series × month index.
- In the example plain exponential smoothing did not beat the naive method: WAPE 15.8% against 15.5%. A method that does not beat the benchmark is not adopted: smoothing without seasonality misses the annual pattern, and the gain comes from the seasonal index (7%).
New items: analog forecast
- Pick 3-5 analogs by category, price, season and assortment role; build a weekly life-profile of shares from their sales (in the example the first two weeks give 31% of season sales).
- New item season forecast = early-weeks sales ÷ share of those weeks in the profile: 310 units in two weeks give 1000 units for the season; a ±10% error in the early window gives ±10% on the total, so the early re-forecast comes with an interval.
Error and forecast control
- WAPE weights error by volume and does not break on small values (the definition: the term “Forecast error (WAPE) and bias”); MAPE averages percentages and is skewed by small SKUs; bias shows systematic over- or under-forecasting.
- Tracking signal = cumulative error ÷ MAD (mean absolute deviation); leaving ±4 (an illustrative threshold) means a systematic shift: the forecast must be revised, not waited out.
- Brand: error is measured at the order horizon (4-9 months ahead), not the week; Retailer: at the replenishment horizon (1-4 weeks) and separately at the season purchasing horizon.
Brand and retailer: how the forecast differs
- Brand: a horizon of 4-9 months before delivery: a season forecast by model and color with an interval is needed and the size split follows by the curve afterwards; weekly accuracy is secondary.
- Retailer: a horizon of 1-4 weeks for replenishment and the season for purchasing: a forecast by store, category and week allowing for weekday, where weekly accuracy determines shelf gaps.
- Brand: the sell-in layer (partner orders) depends on their stock and on terms, so sell-out and a partner stock adjustment are forecast separately; without it the “stocked up” effect is taken for demand.
- Retailer: a retailer plans its own promotions and markdowns, so they enter the model as known events, and the promo effect is estimated from past promotions with the post-promotion dip taken into account.
- Brand: brand new items are forecast by analogs and by partner pre-orders; the early signal is the pre-order share of the partner potential, rescaled to the season.
- Retailer: retailer new items are forecast by analogs and by first-week sales in pilot stores; the forecast is split by store using the store category share.
- Brand: a brand assesses forecast error at model and color level by season and compares it with the actual sell-through; an upward bias means leftovers at partners and returns.
- Retailer: a retailer assesses forecast error by categories and weeks; a downward bias means lost sales and an empty shelf, an upward bias leftovers and markdowns.
- Brand: a brand watches the tracking signal by model groups monthly; a trigger is a reason to revisit the fabric reorder or the factory slot while that is still possible.
- Retailer: a retailer watches the tracking signal by categories and stores weekly; a trigger starts a recalculation of replenishment parameters and a reallocation of stock between stores.
Where the data comes from
| Data source | Fields |
|---|---|
| Sales and stock records | Sales and stock by SKU, store and day; an “out of stock” flag; price and discount on the date. |
| Event calendar | Promotions, holidays, weather, openings and closures, 4-5-4 calendar shifts; without it events end up in “noise”. |
| Item card and analogs | Category, price, season, role, list of analogs and their weekly sales profiles. |
How to build it step by step
- Step 1. Define the horizon and step: replenishment (weeks, 1-4 ahead), season purchasing (months, 4-9 ahead). Each horizon gets its own method and metric.
- Brand: Step 2. Assemble the series by model and color from shipments and partner sell-out; without sell-out estimate demand from shipments adjusted for the partner stock.
- Retailer: Step 3. Assemble the series by store and category; reconstruct demand on out-of-stock days; tag events.
- Step 4. Compute seasonal indices from full years (at least two, preferably three) and normalize to an average of 1.
- Step 5. Deseasonalize the series (actual ÷ index), pick α by the minimum sum of squared errors on the training window (grid 0.05-0.95) and get the level.
- Step 6. Build the forecast: level × period index; if there is a trend add it separately instead of inflating α.
- Step 7. For new items build the analog profile and re-forecast after the first or second week; fix the control week.
- Step 8. Test the method on a hold-out window (the last 12 months take no part in tuning) and compare with naive and seasonal naive; a method that does not beat the benchmark is not adopted.
- Step 9. Set up control: WAPE and bias by horizon, tracking signal by group; when a threshold is crossed start a root-cause review.
- Step 10. Hand the forecast to OTB, orders and the budget with its error interval: the purchase plan is set on the median, the safety margin through safety stock and risk.
Formulas
| Measure | Formulas | Note |
|---|---|---|
| Exponential smoothing | L_t = α·y_t + (1 − α)·L_(t−1); forecast_(t+h) = L_t | α close to 1 for a series with level shifts, close to 0 for a stable one; tune on the training window. |
| Seasonal index | I_m = (1/K)·Σ_k ( y_(k,m) / ȳ_k ), then I_m := I_m / mean(I) | K is the number of full years; moving holidays are handled by the calendar. |
| Index × level forecast | F_(t+h) = L̃_t · I_((t+h) mod 12), L̃ the level of the series y/I | A trend is added as a multiplier (1 + g)^h when confirmed. |
| MAPE and where WAPE is | MAPE = mean(|A−F|/A); WAPE and bias are defined in the term “Forecast error (WAPE) and bias” and in the “Forecast accuracy by week” calculation | MAPE is undefined at A = 0; for sparse series use WAPE. |
| Tracking signal | TS_t = Σ_(i≤t)(A_i − F_i) / MAD_t, MAD_t = mean(|A_i − F_i|) | The ±4 threshold is illustrative; a negative value means forecast above actual, a positive one below. |
| Analog forecast of a new item | Q_season = Q_early / Σ_(w≤W) s_w, s_w profile weekly shares, Σ s_w = 1 | The profile is normalized to the season; early weeks with a promotion or restock distort the share. |
Formulas in notation
- Forecast
F_{t+h} = L̃_t · I_{(t+h) mod 12}
Level of the deseasonalized series times the month index.- MAPE
MAPE = mean(|A_t − F_t| / A_t)
The mean percentage error: skewed by small SKUs; WAPE is volume-weighted (the term “Forecast error (WAPE) and bias”).- Bias
Bias = Σ(F_t − A_t) / Σ A_t
Plus: over-forecast; minus: under-forecast.- Analog forecast
Q_season = Q_early / Σ_{w ≤ W} s_w
Scaling early sales by the analog profile.
Worked example
Comparison of five methods on a 12-month hold-out (one step ahead, a 36-month series)
| Method | WAPE, % | MAPE, % | Bias, % |
|---|---|---|---|
| Naive (last month) | 15.5 | 16.2 | 0.7 |
| Seasonal naive (same month last year) | 7 | 6.5 | 2.2 |
| Moving average, 3 months | 20.6 | 21.9 | 2.7 |
| Exponential smoothing | 15.8 | 16.6 | 0.9 |
| Seasonal index × smoothed level | 7 | 7 | 0.9 |
A 36-month series is generated in code: a level with shifts, an annual pattern and noise. The best method by WAPE is “index × level” (7%), the closest competitor is seasonal naive (7%); methods without seasonality err about twice as much (15.5-20.6%). New item: 310 units in two weeks at a 31% share give 1000 units for the season. The data is illustrative.
Figures
- Actual
- Index × level
- Last year
- Moving average 3
Data as a table
| Measure | Actual | Index × level | Last year | Moving average 3 |
|---|---|---|---|---|
| 1 | 619 | 521 | 592 | 984 |
| 2 | 592 | 602 | 594 | 876 |
| 3 | 695 | 691 | 651 | 735 |
| 4 | 778 | 768 | 765 | 635 |
| 5 | 784 | 786 | 750 | 688 |
| 6 | 678 | 685 | 648 | 752 |
| 7 | 549 | 637 | 559 | 747 |
| 8 | 614 | 628 | 631 | 670 |
| 9 | 881 | 787 | 819 | 614 |
| 10 | 825 | 952 | 940 | 681 |
| 11 | 810 | 907 | 1,015 | 773 |
| 12 | 938 | 878 | 996 | 839 |
Actual and forecasts on the hold-out. The “index × level” method follows the seasonal pattern; the moving average lags and flattens peaks. Axis: month of the hold-out (1-12).
- WAPE
- MAPE
Data as a table
| Measure | WAPE | MAPE |
|---|---|---|
| Naive (last month) | 15.5 | 16.2 |
| Seasonal naive (same month last year) | 7 | 6.5 |
| Moving average, 3 months | 20.6 | 21.9 |
| Exponential smoothing | 15.8 | 16.6 |
| Seasonal index × smoothed level | 7 | 7 |
Method errors: WAPE and MAPE. Seasonality halves the error compared with methods without it.
- Tracking signal
- Threshold +4
- Threshold −4
Data as a table
| Measure | Tracking signal | Threshold +4 | Threshold −4 |
|---|---|---|---|
| 1 | 1 | 4 | −4 |
| 2 | 1.62 | 4 | −4 |
| 3 | 2.45 | 4 | −4 |
| 4 | 3.33 | 4 | −4 |
| 5 | 3.97 | 4 | −4 |
| 6 | 4.21 | 4 | −4 |
| 7 | −1.71 | 4 | −4 |
| 8 | −3.36 | 4 | −4 |
| 9 | −3.78 | 4 | −4 |
| 10 | −6.44 | 4 | −4 |
| 11 | −8.05 | 4 | −4 |
| 12 | −8.95 | 4 | −4 |
Tracking signal under systematic over-forecasting. From month seven the forecast is 12% too high (an illustrative distortion). In month 6 the signal (4.2) crosses the +4 threshold before any shift: a false alarm caused by noise. The real shift is caught by the −4 threshold in month 10 (-6.4); in month 9 the signal is still -3.8.
Data as a table
| Measure | WAPE by horizon, months |
|---|---|
| 1 | 8.4 |
| 2 | 11.1 |
| 3 | 11.9 |
| 6 | 21.3 |
| 9 | 18.2 |
| 12 | 7.3 |
Error and forecast horizon. The longer the horizon the higher the WAPE; on the annual horizon the seasonal pattern helps, so error does not grow monotonically.
Data as a table
| Measure | Season forecast, units |
|---|---|
| -20% | 800 |
| -10% | 900 |
| 0% | 1,000 |
| +10% | 1,100 |
| +20% | 1,200 |
New-item forecast under error in early sales. The season forecast depends linearly on early sales: ±10% in the first two weeks is ±10% on the total.
Specifics by category
- Apparel
- Seasonality is two-peaked (spring-summer, autumn-winter) and weather-dependent; indices are built by season groups (outerwear, light knitwear), not for the whole category.
- Footwear
- Demand runs by size and by weather switches (mid-season, winter); forecast at model level and then split into sizes by the curve, not size by size.
- Accessories
- Gift peaks and moving holidays; indices by weeks around the date, not by months; new items are forecast by analogs especially often as the range turns over fast.
- Kids
- Child growth and the school calendar set the peak and size shifts; demography and price sensitivity change the level; forecast by age groups.
- Men
- Demand is steadier, seasonal indices weaker, so simple smoothing is often enough; basics are forecast by smoothing, seasonal models by analogs.
- Women
- Fashion waves and a short life cycle: new items are a large share, so the share of analog forecasts and the early re-forecast frequency are higher; check forecast bias for full price and sale separately.
Common mistakes
- Sales rather than demand are forecast → scarce items are underestimated and ordered short → reconstruct demand on out-of-stock days.
- The method is chosen by MAPE on small SKUs → items with near-zero sales decide the result → evaluate by WAPE and by groups.
- α and indices are fitted on the whole series and tested on it → false accuracy → a hold-out window excluded from tuning.
- Bias is not monitored → systematic over-forecasting piles up in stock → monitor bias and tracking signal by group.
- A new item is forecast from the most successful “analog” → an optimistic plan → use several analogs and the median profile.
- A forecast is taken as a promise → a plan without an interval → show the range and provide margin through safety stock rather than inflating the point.
Russian specifics
- Retailer: Russian season series depend on regional weather and the school calendar; indices by federal district or climate zone beat a single chain index but need enough store history in the zone.
- Brand: some partners do not provide sell-out; then demand is estimated from shipments and partner stock under a data-sharing agreement whose terms are fixed in the contract. Rule: Civil Code part 2: Civil Code, part two (including Arts. 513, 713, 990, 1027) (rule check not completed).
- Forecasts by customers and cohorts on personal data require consents and anonymization; an aggregated demand forecast needs no person identifiers. Rule: Law 152-FZ of 27.07.2006: Federal Law of 27.07.2006 No. 152-FZ on personal data (rule check not completed).