Overview
Standard models struggle when 80–90% of periods have zero demand: they forecast tiny fractional values or get dragged to zero. Croston’s idea is to split the series into two easier ones: the size of each non-zero demand, and the interval between demands. Each is smoothed with simple exponential smoothing, and the forecast is demand per period: size divided by interval.
Syntetos & Boylan showed the original estimator is biased upwards and proposed a correction (SBA). Teunter, Syntetos & Babai’s TSB variant smooths the probability of demand instead of the interval, so the forecast decays when an item stops selling: useful for obsolescence.
How it works
Updating only in periods with demand \(z_t>0\), with \(q\) the periods since the last demand:
\[\hat z_t=\hat z_{t-1}+\alpha(z_t-\hat z_{t-1}),\qquad \hat p_t=\hat p_{t-1}+\alpha(q-\hat p_{t-1})\] \[\text{Croston: }\hat y=\frac{\hat z}{\hat p}\qquad \text{SBA: }\hat y=\left(1-\frac{\alpha}{2}\right)\frac{\hat z}{\hat p}\]TSB updates a demand probability \(\hat\pi_t\) every period (towards 1 if demand occurred, 0 otherwise) and forecasts \(\hat y=\hat\pi\,\hat z\).
When to use it
Use it for
- Spare parts, MRO and long-tail retail items
- Inventory planning, where total demand over a lead time matters
- Many low-volume series
Avoid it for
- Smooth, frequently non-zero demand (use ETS)
- Lumpy demand driven by known events (model the events)
Key settings
| Setting | What it controls | Typical value |
|---|---|---|
alpha | Smoothing for size and interval | 0.05–0.2 |
alpha_d, alpha_p | TSB smoothing for demand size and probability | 0.05–0.3 |
Python example
import numpy as np import pandas as pd from statsforecast import StatsForecast from statsforecast.models import CrostonClassic, CrostonSBA, TSB, Naive # two years of daily spare-part demand: sold on ~15% of days, in small quantities rng = np.random.default_rng(7) n = 730 demand = np.where(rng.random(n) < 0.15, rng.poisson(4, n) + 1, 0) df = pd.DataFrame({"unique_id": "part-42", "ds": pd.date_range("2024-01-01", periods=n, freq="D"), "y": demand.astype(float)}) train, test = df.iloc[:-60], df.iloc[-60:] models = [CrostonClassic(), CrostonSBA(), TSB(alpha_d=0.1, alpha_p=0.1), Naive()] fc = StatsForecast(models=models, freq="D").forecast(df=train, h=60) # compare against total demand over the horizon: what inventory planning cares about print(f"actual demand next 60 days: {test['y'].sum():.0f} units") for m in ["CrostonClassic", "CrostonSBA", "TSB", "Naive"]: print(f"{m:15s} per-day {fc[m].iloc[0]:.3f} 60-day total {fc[m].sum():6.1f}")
Tips & pitfalls
- Judge forecasts on cumulative demand over the lead time, not per-period MAE, which rewards forecasting zero.
- Classify series first: ADI > 1.32 suggests intermittent; high CV² of sizes suggests lumpy.
- Croston gives a flat rate, not a timing forecast: combine it with a safety-stock model.
References
- Croston, J. D. (1972). Forecasting and stock control for intermittent demands. Operational Research Quarterly, 23(3), 289–303.
- Syntetos, A. A., & Boylan, J. E. (2005). The accuracy of intermittent demand estimates. International Journal of Forecasting, 21(2), 303–314.
- Teunter, R. H., Syntetos, A. A., & Babai, M. Z. (2011). Intermittent demand: linking forecasting to inventory obsolescence. European Journal of Operational Research, 214(3), 606–615.