S2 · conceptual understanding
Censoring and the all-days denominator
Sales are a truncated view of demand, so this lesson shows when to divide by calendar days and when by in-stock days — and what each choice biases.
Prerequisites
Going Forward
The merchant question: should I divide my sales by 90 days or by the 79 days I actually had stock?
Both, for different questions — and the error is not picking the wrong one, it is not knowing which one you picked. Dividing by 90 gives you the rate at which units left the building per calendar day. Dividing by 79 gives you an estimate of the rate at which customers wanted units while you could serve them. The first is a fact about your operations. The second is a guess about your market. Neither is "the" demand rate, and a formula that mixes them silently will produce a number that is confidently wrong in a specific direction.
What censoring means
Demand is a latent process: on any given day, some number of customers want the mug. Sales are not that number. Sales are the smaller of demand and what you had:
sales = min(demand, available)
When available is plentiful, sales track demand. When available hits zero, sales are pinned at zero regardless of how many people wanted one. The statistician's word for this is censoring — the observation is cut off at a boundary, and everything beyond the boundary is invisible. A stockout at zero is a hard censoring point, and it is worse than ordinary missing data, because the missing values are not missing at random. They are missing precisely when demand was high enough to empty the shelf.
This has a direct consequence for the series: a zero-sales day is ambiguous. It could mean nobody wanted the mug (demand was zero) or everybody who wanted it was turned away (demand was high, availability was zero). Two opposite states of the world produce identical observations. No amount of arithmetic on the sales series alone can separate them, which is why the availability history is not optional.
The two denominators, side by side
Marlow & Finch, MUG-GRN-12, 90 days, 559 units sold, 11 dark days.
All-days: 559 ÷ 90 = 6.21 units per calendar day. In-stock days: 559 ÷ 79 = 7.08 units per in-stock day.
The mean moves 12.3% between the two. That is the mild part. The variance moves too, and in the opposite direction, because the all-days series mixes two populations: 79 days drawn around a mean of 7.08 with a standard deviation of 3.5, and 11 days pinned at zero. Treating the 79 in-stock values as a distribution with E[x²] = 3.5² + 7.08² = 62.38 and weighting by 79/90 gives an all-days second moment of 54.76. Against an all-days mean of 6.21:
variance = 54.76 − 6.21² = 54.76 − 38.58 = 16.18, so σ = 4.02 units
The standard deviation rose from 3.5 to 4.02 — up 15% — without a single new observation. Nothing about the mug changed. The zeros are not variability in demand; they are variability in availability, and including them labels one as the other.
Why this matters in money and units
Feed both versions into the reorder point and the difference is not academic.
In-stock version: lead-time demand 7.08 × 45 = 319; σ_LTD = √(45 × 12.25 + 1,015.13) = 39.58; SS = 1.65 × 39.58 = 65; ROP = 384.
All-days version: lead-time demand 6.21 × 45 = 279; σ_LTD = √(45 × 16.18 + 1,015.13) = √1,743 = 41.75; SS = 1.65 × 41.75 = 69; ROP = 348.
The all-days reorder point is 36 units lower. Two errors are working against each other — an understated mean and an overstated spread — and they nearly cancel in the buffer while producing a materially lower trigger point. That partial cancellation is what makes this failure so hard to catch: the safety stock looks roughly right, the ROP looks plausible, and the mug still goes dark, at which point the eleven dark days get folded back into next quarter's export and the estimate drifts further.
The decision rule
Use the denominator that matches the quantity your formula is asking for.
- Replenishment rate → in-stock days. A reorder point asks "how much will be consumed while I wait for stock?" — a question about demand conditional on being able to serve it. Use 7.08.
- Cash, turnover, budget → all days. A cash plan asks "how many units will I ship this year?" — and you ship nothing on a dark day. 6.21 per calendar day is the honest basis for annual units, dollar forecasts for the P&L, and turnover ratio.
- Never mix. A single formula that divides an all-days annual figure by an in-stock daily rate is comparing two different stores.
There is a third option worth knowing: imputation. Instead of deleting dark days, replace them with an estimate of the demand that was turned away — commonly the in-stock mean, sometimes a seasonally adjusted one. That produces one series with no gap, at the cost of inventing data. It is defensible when dark days are scattered and indefensible when they cluster on peaks.
Where this breaks
The in-stock correction assumes unmet demand resembles demand on in-stock days. That assumption is false in exactly the case that matters. Items go out of stock because demand spiked; the dark days are disproportionately high-demand days, so 7.08 is a lower bound on the demand that was actually there. The correction removes the visible zero and leaves the invisible peak.
It also fails when the stockout is partial. A day where two of forty units were available records two sales and looks like a terrible demand day, not a stockout. Partial availability censors the observation above zero, and the min() is invisible unless the availability history has intraday resolution. Stores selling from a single count that goes to zero are easy; stores with a floor and a 3PL and a marketplace buffer are not.
Substitution breaks it in both directions. When the green mug is dark and customers buy blue, green's censored mean is too low and blue's is too high, and both series look complete and well-behaved. Only a substitution report — same-customer or same-session cross-purchase — reveals it.
Finally, the all-days basis has a boundary of its own: it is the right denominator for a plan, but it is a terrible denominator for learning. A store that only ever looks at all-days rates will conclude its demand is stable and slightly lower than it is, and will keep producing the stockouts that justify the conclusion. See Sizing safety stock from variance for what happens when the inflated σ is carried into buffer sizing, and My bestsellers keep going dark for the operational version of the same loop.