Contents/ Part XXXII · Capstone Projects: Time Series & Forecasting/ Chapter 200

Intermittent Demand: Spare Parts

Capstone 37. Sixty part numbers, three years, and no demand at all in three weeks out of five. The error measure the warehouse reports every month cannot be computed on most of its own data, and the forecast that scores best on it would empty the shelves.

⏱️ ~25 min read
🎯 Croston, MASE, service levels
📊 Chapter 200
The brief
Setting
A machinery dealer's parts warehouse. Sixty part numbers, three years of weekly issues, stock reviewed weekly and a supplier who delivers two weeks after an order, so every order has to cover three weeks.
The question
How many of each part should be held, so that 95 units in every 100 demanded ship the day they are asked for?
Why it matters
Hold too little and a machine stands idle in a field. Hold too much and the money is on a shelf. The catalog is mostly slow movers, which is where both mistakes are easiest to make.
What we do
Classify the catalog, find the part that is dead rather than slow, show why the reported percentage error cannot be computed, compare four forecasting methods on MASE, and then price the service level that actually decides the answer.

Every method in this chapter is judged twice: once on how close its forecast came, and once on whether the stock it implied served the customer. The two answers do not agree, and the gap between them is the chapter.

1

Three Weeks in Five Are Empty

The extract arrived with 9,420 rows for what should be 60 parts across 156 weeks. One week had been extracted twice, one part number was written three ways, a customer return was booked as minus eleven units and a stock count of 9,999 had been typed into the issues column. After cleaning, 60 parts, 156 weeks and 17,925 units issued in total.

Part-weeks with no demand
61.0%
zero is the most common observation
Typical order, when there is one
3 units
quartiles 1 to 5, largest 222
Weeks between orders
1.0 to 9.2
across the sixty parts
Four panels. Top left: total weekly units across all sixty parts, an ordinary noisy series between about 50 and 290. Top right: three individual parts drawn as stems, one smooth with 10 percent of weeks empty, one intermittent with 75 percent empty and one lumpy with 80 percent empty. Bottom left: every part plotted by squared coefficient of variation of order size against weeks between orders, with the 0.49 and 1.32 cut-offs drawn, giving smooth 6, erratic 7, intermittent 21 and lumpy 26. Bottom right: what a part-week contains, 61.0 percent nothing, 27.7 percent one to four units, 10.0 percent five to nineteen and 1.3 percent twenty or more.
Top left: added together the sixty parts make an ordinary, well-behaved series, which is how aggregate demand planning hides this problem. Top right: the series that actually have to be forecast, drawn so an empty week reads as empty. Bottom left: every part on the two axes that matter, with the published cut-offs. All four cells are occupied. Bottom right: the largest bar is the one on which a percentage error is undefined.

The classification is the Syntetos-Boylan-Croston scheme: how many weeks pass between orders, and how much the order sizes vary. Both cut-offs are the published ones. Here it gives 26 lumpy, 21 intermittent, 7 erratic and 6 smooth, and the four groups need different things, which is the reason for classifying at all.

2

One Part Is Not Slow, It Is Dead

A part that has stopped moving and a part that moves rarely look identical in a spreadsheet, and they need opposite decisions. The way to tell them apart is to measure silence in units of that part's own rhythm rather than in weeks.

PartWeeks since the last orderIts own typical gapRatio
P1024372.614.0×
P1052215.43.9×
P1053113.43.3×

Fourteen times its own gap, against a runner-up at four. P1024 was superseded by a newer part number partway through the history. In the year that was held back it was issued zero units, and every method in this chapter would have produced a small positive forecast for it, the warehouse would have stocked it, and the stock would never have moved.

Four weeks of quiet means nothing for a part ordered twice a year and a great deal for one ordered every fortnight. That is why the test is a ratio. It is a decision about the catalog rather than about forecasting, and it belongs before any of it: P1024 is excluded, leaving 59 parts.

3

The Error Measure That Cannot Be Computed

The planning tool reports a mean absolute percentage error every month. A percentage error divides by the actual demand. On a week when nothing was demanded, there is nothing to divide by.

What the tool was actually reporting

The holdout year contains 3,068 part-weeks, of which 1,867 have zero demand. MAPE is undefined on every one of them. There is not a single part in the catalog where it can be computed for the whole year, and the share of the year it would actually be computed on is 39.1 percent. The number that reached the monthly pack was a percentage error on the weeks that happened to have demand.

Those are the easy weeks. A forecast is roughly right about a week with demand far more often than it is right about which weeks will have any, so the measure was scoring the part of the problem that was not the problem. It did not fail loudly. It dropped the undefined rows and averaged what was left.

The replacement used from here is MASE, the mean absolute scaled error, which divides by the average absolute week-to-week change of the series itself rather than by the actual. It is defined on zeros, it is comparable across parts of very different sizes, and below 1 means the forecast beat a rule that just repeats last week.

4

Four Methods, and a Race That Nearly Ties

Two years of history for each part, one number out. Croston's method is the one built for this problem: instead of smoothing the raw series, it smooths the order size and the interval between orders separately and divides one by the other. SBA is Croston with the Syntetos-Boylan correction, a multiplier of one minus half the smoothing constant, which exists because a ratio of two smoothed estimates is biased upward.

ClassPartsNaiveSESCrostonSBA
Smooth60.7530.7510.7520.757
Erratic71.1400.8480.8420.823
Intermittent210.8500.9010.9450.929
Lumpy261.4460.8900.8870.871
All parts591.1370.8750.8880.873

SBA is best overall, and the margin over plain exponential smoothing is 0.002. It wins the erratic and lumpy classes, where sizes swing about and the upward bias bites hardest, and it loses the intermittent class to the naive rule. The Syntetos-Boylan correction is worth 0.014 MASE against uncorrected Croston, which is small and free.

The naive rule is the worst overall by a wide margin, and it is worth pausing on why that is not obvious: on the aggregate warehouse series in the first picture, repeating last week would have looked perfectly respectable.

5

Why the Race Is Close, and What That Says

Three of the four methods land within two percent of one another. That is not because the methods resemble each other. It is a property of the measure, and the cleanest way to see it is to ask what the best possible constant forecast would have been, chosen with hindsight.

Best constant forecast
zero
for 44 of the 59 parts
Its MASE
0.622
against SBA's 0.873
Its fill rate
nil
it orders nothing, ever

Mean absolute error is minimized at the median, and for a part ordered once a month the median week contains no demand at all. So a scoreboard built on absolute error rewards whichever method leans lowest, and the outright winner of that contest is a policy that never orders anything. It beats all four honest methods by a wide margin.

This is the metric lesson from Chapter 198 in its most extreme form. The measure has to come from the decision. The decision here is how many units to hold, and that is answered by a quantile of demand over the lead time. It is not answered by an average of weekly demand, and it is certainly not answered by whichever method minimizes an error statistic.

6

The Number the Warehouse Actually Needs

A forecast of 0.74 units a week is never the demand in any week. The warehouse orders against a level: hold this many, top up weekly, and the supplier takes two weeks. So the quantity to get right is total demand over the three weeks an order has to cover, and specifically a high quantile of it.

For one lumpy part, P1045Order up toFill rateUnits held
The middle of three-week demand0.69.6%0.3
The 80th percentile3.644.8%2.3
The 95th percentile12.684.6%10.2

Ordering to the middle fills fewer than one unit in ten. That is not a broken calculation. Half of all three-week windows fall above the middle, and in demand shaped like this the ones that do fall a long way above. Everything past the middle is safety stock, and how much of it to hold is the decision the warehouse is really making.

7

What Moves the Fill Rate

Every live part run through the policy, for each method and each service quantile, scored on the year that was held back.

Service quantileNaiveSESCrostonSBA
0.5037.2%45.1%46.0%44.0%
0.8063.3%76.2%78.6%77.6%
0.9079.4%86.7%87.3%86.9%
0.9589.8%92.4%92.9%92.7%
0.9894.4%95.8%96.2%96.1%

At the service level the business asked for, the four methods span 3.0 points of fill rate, and most of that is the naive rule being poor. Holding the method fixed and moving the quantile moves the fill rate by 52.1 points. The choice nobody discusses has seventeen times the leverage of the choice everyone argues about.

That is not an argument for choosing a method carelessly. SBA is free and slightly better, so use it. It is an argument about where the attention belongs, and in most warehouses it is pointed at the forecast.

Two panels. Left: mean MASE for the four methods, naive 1.137, SES 0.875, Croston 0.888 and SBA 0.873, with a dashed line at 0.622 marking the best constant forecast, which is zero for most parts and beats all four. Right: fill rate achieved against average units held, for all four methods; three of the curves lie almost on top of one another while the naive curve sits below them, with a dashed line at the 95 percent target.
Left: the dashed line is the best constant forecast chosen with hindsight, which is zero for 44 of the 59 parts. It beats all four methods. A scoreboard on which "order nothing" wins is not measuring what the warehouse cares about. Right: the same methods plotted the way the decision is made, as stock held against service delivered. Three of the curves are almost the same curve. Where you sit along it is worth tens of points; which of the three you are on is worth almost nothing.
8

The Quantile You Ask For Is Not the Service You Get

Asking for the 0.95 quantile of lead-time demand delivered a fill rate of 92.7 percent, not 95. Those are different quantities. The quantile controls how often a replenishment cycle runs short; the fill rate counts units, and a cycle that runs short by twenty units counts worse than one that runs short by one. If the business has agreed a fill rate, the quantile has to be tuned until the simulation delivers it.

QuantileFill rateUnits heldExtra stock per point of fill rate
0.5044.0%1.6
0.8077.6%4.80.09
0.9086.9%7.60.30
0.9592.7%11.10.61
0.9896.1%19.72.46

The last few points of service cost twenty-seven times what the first ones did. Going from 44 to 87 percent costs six units a part. The next nine points cost twelve more. That curve, and not the forecast, is what a service-level conversation should be held over, because it is the only place in this chapter where the business is being asked to spend money.

9

What This Does Not Settle

One smoothing constant, never tuned. Every method here uses 0.10, the conventional default for intermittent demand. Tuning it per part on a rolling origin would tighten the forecasts a little and would not move the service curve, which is the part that matters.

The spread came from history, not from a model. The order-up-to level takes its level from the forecast and its spread from that part's own past three-week windows. A part whose pattern is changing gets a stale spread and nothing here would notice.

Fill rate is not the only service measure. Counting units treats one customer waiting for twenty parts the same as twenty customers waiting for one each. If the second is worse for the business, the target should not be a fill rate.

Every part was treated as its own problem. Parts that fail together, or that substitute for one another, break that assumption in opposite directions. For sixty parts that is defensible. For sixty thousand it is where the remaining gains are.

10

What to Watch

11

Intermittent Demand in Data Science & AI

Intermittency is the standard case in service parts, and it appears wherever events are rare enough that most periods are empty. In all of them the useful output is a distribution rather than a number, and most forecasting stacks return a number.

Where it shows upThe zeros areWhat the decision needs
Service parts and after-salesWeeks with no failureA stock level that meets a service target
Insurance claims by policyYears with no claimA reserve covering a high quantile of loss
Rare-event alertingHours with no incidentA threshold priced against the cost of a miss
Long-tail retail and marketplacesDays with no sale for that itemA reorder point, per item, at scale
Where the methods came from

Croston proposed separating size from interval in 1972. Syntetos and Boylan showed in 2001 that the resulting ratio is biased upward and gave the correction used here, then in 2005 published the classification scheme with the two cut-offs this chapter uses. The modern direction is to model the distribution directly rather than its mean: negative binomial and compound Poisson formulations, quantile-based deep models such as DeepAR trained across a whole catalog, and zero-inflated approaches. All of them are aimed at the same target as Section 8, which is the quantile rather than the average, and none of them removes the need to simulate the policy and measure the service actually delivered.

🐍

The full project, step by step

The companion notebook cleans the export, classifies all sixty parts on the Syntetos-Boylan-Croston plane, separates the superseded part from the slow ones, shows how much of the year a percentage error could be computed on, implements Croston and SBA from scratch alongside two baselines, finds the best possible constant forecast, and then simulates a weekly review policy across every method and every service quantile.

📓 View Notebook (code & outputs) ▶ Open in Colab ⬇ View / Download on GitHub
Read the reports & get the data

The dataset (capstone-intermittent-demand-spare-parts.xlsx) holds three years of weekly issues for sixty part numbers, 9,360 rows once the duplicated week is removed, with the parts family and the messy layer the export arrived with. Two written reports accompany it: a plain-language brief for the parts director, and a technical report covering the classification, the four methods, the MASE comparison and the policy simulation.

🎓 Key Takeaways

  • Three part-weeks in five contain no demand, so the monthly MAPE could be computed on 39.1 percent of the year and on no single part in full.
  • One part was dead rather than slow, silent for 14 times its own typical gap against a runner-up at 4, and it was issued zero units in the holdout year.
  • SBA was best overall at 0.873 MASE, ahead of exponential smoothing by 0.002 and of uncorrected Croston by 0.015, and it lost the intermittent class to a naive rule.
  • Forecasting zero everywhere scores 0.622 and beats all four, because absolute error is minimized at the median and the median week is empty.
  • The method is worth 3 points of fill rate and the service quantile is worth 52. Asking for the 0.95 quantile delivered 92.7 percent, and the last three points of service cost twenty-seven times what the first ones did.

Quiz: Test Yourself