Definition
Croston observed in 1972 that exponential smoothing applied to a series with many zeros gives a forecast that is too high just after a demand, which is when stock is reordered. His method keeps two smoothed quantities, updated only in periods with a demand: the size z of the demand and the inter-demand interval p, the number of periods since the previous one.
z ← z + α (yt − z), p ← p + α (q − p), forecast = z ÷ p
Here q is the number of periods since the last demand. The forecast is a demand rate per period, constant until the next demand occurs. Nothing changes during a run of zeros.
Worked example
The first part applies the recursion to one series. The second part measures the bias: 5,000 series are simulated with a known mean demand, and the average Croston forecast is compared with it. The functions come from intermittent-eval, our open-source package (pip install intermittent-eval).
import numpy as np
from intermittent_eval import croston, sba
y = np.array([0, 0, 4, 0, 0, 0, 2, 0, 3, 0, 0, 0, 0, 5, 0, 0])
alpha = 0.2
nz = np.flatnonzero(y)
z, p, q = float(y[nz[0]]), float(nz[0] + 1), 1
for t in range(nz[0] + 1, len(y)):
if y[t] > 0:
z += alpha * (y[t] - z); p += alpha * (q - p); q = 1
else:
q += 1
print(f"size z = {z:.3f} interval p = {p:.3f} forecast = {z / p:.3f} package: {croston(y, alpha):.3f}")
rng = np.random.default_rng(0)
Y = rng.binomial(1, 0.2, (5000, 200)) * rng.integers(1, 6, (5000, 200)) # true mean = 0.2 * 3 = 0.6
for name, f in [("Croston", croston), ("SBA", sba)]:
mean_f = np.mean([f(row, alpha) for row in Y])
print(f"{name:8s} mean forecast = {mean_f:.3f} true mean demand = 0.600 bias = {100 * (mean_f / 0.6 - 1):+.1f} %")Output, produced by running the code above when this page was built:
size z = 3.784 interval p = 3.368 forecast = 1.124 package: 1.124 Croston mean forecast = 0.649 true mean demand = 0.600 bias = +8.2 % SBA mean forecast = 0.584 true mean demand = 0.600 bias = -2.7 %
The hand recursion and the package agree. Averaged over the simulated series, Croston's forecast is above the true mean, and the corrected version, SBA, is close to it.
Where it misleads
The forecast is a ratio of two smoothed quantities, and the expected value of a ratio is not the ratio of the expected values. Syntetos and Boylan showed in 2001 that the bias grows with the smoothing constant and with the interval between demands.
- The forecast never decreases while demand is absent. An item that stops selling keeps its last forecast for ever. TSB was designed for that case.
- The result depends on how z and p are initialised, and software packages differ. Two libraries can give different Croston forecasts for one series.
- The method gives a mean rate, not a distribution. A reorder point needs a quantile of the demand over the lead time, which must be modelled on top.
In our work
Croston, SBA and TSB are the classical methods in every comparison we run on intermittent demand, with the initialisation written down. On 2,404 spare-part series the smoothing methods over-forecast by 16 % to 37 %.
Service: forecasting and statistical studies Research note: intermittent demand forecasting, measured
References
- Croston, J. D. (1972). Forecasting and stock control for intermittent demands. Operational Research Quarterly, 23(3), 289-303. doi:10.1057/jors.1972.50
- Syntetos, A. A., Boylan, J. E. (2001). On the bias of intermittent demand estimates. International Journal of Production Economics, 71(1-3), 457-466. doi:10.1016/S0925-5273(00)00143-2
- Syntetos, A. A., Boylan, J. E. (2005). The accuracy of intermittent demand estimates. International Journal of Forecasting, 21(2), 303-314. doi:10.1016/j.ijforecast.2004.10.001