Sign in

Blog · Data quality and reconciliation · FMCG and CPG brands

Inferring an out-of-stock at one store: the whole arithmetic on one page

The complete out-of-stock inference on one SKU at one store over thirty days, small enough to check by hand: the SKU's own daily sales rate excluding earlier inferred runs, the probability of a zero-sales run of each length at that rate, the confidence threshold, the run that crosses it and the run that does not, lost units at the rate and lost sales at retail, the missing-file day that is not a zero, and why the same run at a slow-selling SKU would not be inferred, so a reader can reproduce every figure and then run it on their own sell-out data.

The short answerOne SKU at one store, thirty days of daily sell-out, average four units a day. The chance of selling zero on any one day at that rate is about 1.8 percent; the chance of a run of three zero days is that cubed, about 0.0006 percent, far below the stated threshold of 0.1 percent, so a three-day run is inferred as an out-of-stock. A one-day zero at 1.8 percent is not. The month has one nine-day run: inferred, thirty-six units lost at the rate, $144 at retail. One day is a missing file, not a zero, and is excluded from the run. The same nine-day run at a SKU selling 0.3 a day would have a probability of 7 percent and would not be inferred. Every number can be reproduced by hand.

Out-of-stock inference is a probability per zero-sales run at the SKU's own rate, and on thirty days at one store the arithmetic fits on a page. This page works the rate, the probability per run length, the threshold, the inferred run, the lost sales, the missing file and the slow-SKU comparison.

The thirty days

Daily units sold; M is a missing file.

Days 1 to 10 4, 5, 3, 4, 6, 4, 3, 5, 4, 4
Days 11 to 20 0, 0, 0, 0, 0, 0, 0, 0, M, 0
Days 21 to 30 5, 4, 4, 3, 5, 4, 0, 4, 5, 4

The rate

Days with a stocked shelf, excluding the run under test and the missing day: days 1 to 10 and 21 to 30, twenty days, 84 units.

Rate = 84 ÷ 20 = 4.2 units per day

The probability of a zero run

At a Poisson rate of 4.2, the chance of zero on one day is e^−4.2 ≈ 0.015, or 1.5 percent. A run of n zero days has probability 0.015^n.

Run length Probability Below the 0.1% threshold?
1 1.5% No
2 0.02% Yes
3 0.0003% Yes
9 negligible Yes

At this SKU's rate, two consecutive zero days is already inferred.

The runs in the month

Run Days Length Probability Inferred?
Days 11 to 18, then 20 9 zero days around a missing file 9 negligible Yes
Day 27 1 1 1.5% No: chance

Day 19 is a missing file and is not counted as a zero; the run is nine days with one unmeasured day inside it.

Lost sales

Lost units = run length × rate = 9 × 4.2 = 38 units Lost sales at retail $4.00 = $152

The same run at a slow SKU

Another SKU at the same store sells 0.3 a day. The chance of zero on a day is e^−0.3 ≈ 0.74. Nine zero days: 0.74^9 ≈ 0.066, or 6.6 percent, above the threshold. Not inferred. A slow seller is often silent for nine days and it means nothing.

The identity

store sell-out per day = the retailer's total per SKU for that store: holds on the 29 measured days; day 19 is unmeasured, listed

Where it goes wrong, even at one store

One threshold for all SKUs. At two days, the slow SKU is flagged every week and the fast one only when it has been empty for days.

Missing file as zero. Day 19 becomes a tenth zero, and a store whose file is late for a week is inferred out of stock of everything.

Rate including the run. 84 ÷ 29 = 2.9; the day-27 zero looks more likely and the next two-day run may be missed.

Presented as fact. The report says inferred, with the model and the rate, and takes the pattern to the buyer, not the accusation.

From one store to a thousand

The same rate per store-SKU, the same probability, the same threshold, with recurrence per store and DC. Covirage runs it on the sell-out files every week. The out-of-stock inference guide covers the measure at scale, and the distribution voids guide covers the SKUs that were never on the shelf.

Questions people ask

Where does the daily probability of zero come from?

From the rate: if sales are roughly Poisson at four a day, the chance of zero on a day is e to the minus four, about 1.8 percent. At 0.3 a day it is 74 percent. The report states the model and the rate; the arithmetic is the exponent.

Why exclude inferred runs from the rate?

Because a rate that includes the empty-shelf days is lower than the true selling rate, and the next stockout is harder to detect. The rate is computed on days the shelf was stocked, and the inferred days are excluded once found.

What about the missing file?

Day 19's file did not arrive. That is not a zero sale; it is an absence of data. It is excluded from the run count, and the run on either side is measured around it. A store absent for a week is unmeasured for the week, not out of stock for it.