ClearStock by InventoryX is live on the Shopify App Store.Install free →

Install ClearStock
English
  • English
Browse Resources

S5 · quantitative skill

Measuring lead time from your own deliveries

How to compute the mean and standard deviation of delivery span from dated purchase orders, and how wide the honest uncertainty on that spread really is.

My supplier quotes 45 days. Do I have enough deliveries to know whether that is true, and how uncertain is the spread?

Short answer: 45 days is a quote, not a measurement, and with eight deliveries you can defend a mean to within about three days and a standard deviation only to within a factor of roughly two. That second number is the one people get wrong, because software prints σ_L to two decimal places and invites you to believe all of them.

This lesson computes two quantities from dated purchase orders: the mean span L̄ and its standard deviation σ_L. Those are the two inputs the safety-stock variance formula needs, and they come from nowhere else.

Define the span before you measure it

You need a start event and an end event, applied identically to every order.

  • Start: the date the purchase order was sent. Not the date it was confirmed — a supplier who takes nine days to acknowledge has added nine days of delay you are planning around whether or not you recorded it.
  • End: the date the stock became available to sell. Not the date the truck arrived, not the date the invoice landed. If goods arrived on Friday and were received into Shopify on Monday, the span is three days longer, because that is when the shelf could actually serve a customer.

Log the span for every purchase order line. Keep the late ones — the whole point is the tail, and dropping an outlier because it was a bad month is how merchants end up with σ_L of 4.5 and a warehouse full of evidence to the contrary. If a delivery arrived in two parts, measure to the point where the line was complete; what you may not do is quietly take the earlier date.

The arithmetic

Marlow & Finch's eight ceramics deliveries for MUG-GRN-12, PO-sent to sellable, in days:

Delivery 1 2 3 4 5 6 7 8
Span 52 39 49.5 41 48 42 43.5 45

Mean. Sum = 52 + 39 + 49.5 + 41 + 48 + 42 + 43.5 + 45 = 360. Divide by 8.

L̄ = 360 / 8 = 45.0 days

Standard deviation. Deviations from 45, then their squares: +7, −6, +4.5, −4, +3, −3, −1.5, 0. Squares: 49 + 36 + 20.25 + 16 + 9 + 9 + 2.25 + 0 = 141.75. Divide by n − 1 = 7 (sample, not population — you are estimating a process you will draw from again), then take the square root.

σ_L = √(141.75 / 7) = √20.25 = 4.5 days

Use n − 1: dividing by 8 instead would understate by 7%, and that error propagates straight into the safety stock.

How much do you actually know?

Two separate uncertainties, and they behave differently.

The mean. The standard error of the mean is s/√n = 4.5/√8 = 1.59 days. A 90% interval on a sample of eight uses the t distribution with 7 degrees of freedom (t = 1.895), giving 45.0 ± 3.0 — the true mean is somewhere in 42.0 to 48.0 days. That is tolerable for planning.

The spread. This is the one that hurts. A sample standard deviation is a noisy estimate of the true σ, and its uncertainty is asymmetric: the distribution of s² is χ², so the interval is wider above than below. For n = 8 (7 degrees of freedom) at 90% confidence, χ²(0.95) = 14.067 and χ²(0.05) = 2.167, so:

  • lower bound: σ × √(7 / 14.067) = 4.5 × 0.705 = 3.17 days
  • upper bound: σ × √(7 / 2.167) = 4.5 × 1.797 = 8.09 days

The 90% band on σ_L is 0.705σ to 1.797σ — from 3.17 to 8.09 days on this sample. Your best estimate is 4.5 and the honest statement is "somewhere between three and eight days".

Why that band matters more than it looks

σ_L enters the lead-time demand variance as σ_LTD = √(L̄ × σ_d² + d̄² × σ_L²). With d̄ = 7.08 and σ_d = 3.5:

  • at σ_L = 4.5: √(45 × 12.25 + 50.13 × 20.25) = √(551.3 + 1,015.1) = √1,566.3 = 39.58 units
  • at σ_L = 8.09: √(551.3 + 50.13 × 65.45) = √3,832.1 = 61.9 units
  • at σ_L = 3.17: √(551.3 + 50.13 × 10.05) = √1,055.1 = 32.5 units

At a 95% cycle service level (z = 1.65), safety stock is 1.65 × σ_LTD, so the same measurement supports 54 units, 65 units, or 102 units depending on where in the band the true σ_L sits. The reorder point moves from 373 to 421. A single container arriving unusually early or late is worth roughly a fortnight of buffer.

Two honest responses, and one dishonest one. Collect more data — the standard error of s is approximately σ/√(2(n−1)), so pinning σ_L to about ±20% at 90% confidence needs on the order of 35 deliveries, which for a supplier shipping monthly is three years. Or manage the uncertainty directly by planning at the upper end of the band, which is defensible if a stockout costs more than carrying the extra 37 units does: 37 units at the $1.28 annual carrying cost is $47 a year, so here the asymmetry is stark. The dishonest response is to treat 4.5 as known and let a spreadsheet compute a reorder point to the unit.

Where this breaks

Non-stationarity. One mean and one σ assume a stable process. A pre-holiday production queue, a factory shutdown at the lunar new year, or a new forwarder breaks that. Sort by month and compute the mean for the first four and last four separately; above those are 45.4 and 44.6, which is no detectable drift — but eight observations cannot detect a small one either.

Censoring. A PO sitting at day 50 that has not arrived is not missing data. It is a lower bound on the span, and excluding it because the delivery has not happened biases σ_L downward exactly when supply is at its worst.

Expedited deliveries. If you paid to air-freight two of the eight, you measured a process you do not normally run. Record the mode and measure each separately.

One container, many lines. Forty PO lines on one shipment are not forty independent observations. Count the container. And any change to order quantity, production slot or forwarder invalidates the history — restart the log.

Assumptions

  • The span is measured from PO sent to stock sellable, on the same definition for every observation, with none dropped.
  • Observations are independent draws from a single stationary process; shared containers, sequential orders to one factory and seasonal queues all violate this and are treated above.
  • The underlying spans are roughly normal, which the χ² interval construction does not require for σ but which the t interval on the mean assumes.
  • σ_d = 3.5 units a day and d̄ = 7.08 units a day are the running example's demand figures, computed on in-stock days only and treated as known here. They are not: they carry their own estimation error, which this lesson ignores.
  • Demand and lead time are independent. A supplier who runs late precisely when demand spikes violates this and makes σ_LTD the wrong variance.
  • z = 1.65 is used as the 95% cycle service multiplier without correction for the uncertainty in σ_L, and the χ² bounds are read at 7 degrees of freedom.