Forecasting and reconciling hierarchies of intermittent time series with fable

46th International Symposium On Forecasting, Montreal, Canada

Dario Azzimonti

IDSIA USI-SUPSI

June 30, 2026

Intermittent time series

Who

This talk presents results and software developed with the help of the whole group

Dario Azzimonti
Dario Azzimonti

(Maintainer bayesRecon and fable.bayesRecon)
Stefano Damato
Stefano Damato

(Maintainer fable.intermittent
Lorenzo Zambon
Lorenzo Zambon

 
Giorgio Corani
Giorgio Corani

 


Special thanks also to Chiara Carrara and Anubhab Biswas.

What are intermittent time series?

Intermittent time series: contain mostly integer-values with many zero values.

Many more formal definitions (e.g. ADI\(>1.32\), Syntetos et al. (2005)).

Examples of intermittent time series

Often arise when modelling sales of SKU in demand forecasting
(Notable examples: M5, VN2, RAF or Auto parts datasets)

 

Today’s running example: Pasta dataset (Mancuso et al. 2021)

  • 118 daily time series

  • from 01/02/2014 to 31/12/2018.

  • Each SKU has a brand.

print(pasta_tsibble, n=3)
# A tsibble: 215,350 x 4 [1D]
# Key:       Brand, SKU [118]
  date       Brand   SKU value
  <date>     <chr> <int> <dbl>
1 2014-01-02 B1        1     7
2 2014-01-03 B1        1     5
3 2014-01-04 B1        1     9
# ℹ 215,347 more rows

Dataset in tsibble format will be avaialble on the next version of fable.intermittent.

How do we forecast intermittent time series?

  • Point forecasts are not reasonable: decision making requires uncertainty

How do we forecast intermittent time series?

  • Point forecasts are not reasonable: decision making requires uncertainty

  • We need to return probabilistic forecasts.

How do we forecast intermittent time series?

  • Point forecasts are not reasonable: decision making requires uncertainty

  • We need probabilistic forecasts and custom models for intermittent time series

fable.intermittent

Package fable.intermittent

10 probabilistic intermittent forecasting models

New model: TWEES Exponential smoothing model with a Tweedie forecast distribution.

TWEES = TWeedie Exponential Smoothing

ETS state-space model, Gaussian observation noise replaced by a Tweedie distribution

\[y_t \sim \text{Tweedie}(\mu_t, \phi, \rho), \quad \text{where}\]

  • \(\mu_t\) follows a (optionally damped) exponential smoothing recursion, as in classical ETS.

  • Dispersion \(\phi\) and power \(\rho\) (smoothing parameters) estimated jointly by maximum likelihood.

  • Naturally produces zeros and occasional spikes

  • No need for a separate “demand occurrence” model (unlike Croston-type methods)

Tweedie distribution

  • Parameters: mean \(\mu>0\), dispersion \(\phi>0\), power \(\rho \in(1,2)\)

  • Point mass at zero and continuous density for \(y>0\)

  • Density has no closed form but it is computable (Dunn and Smyth (2005), Damato et al. (2025))

Tweedie implementation

Fast implementation: dtweedie/ptweedie/qtweedie/rtweedie compiled in C++

  • Compared to the reference tweedie R package, our implementation has

    • Between 1.5x and 6x speed up on dtweedie evaluations

    • Between 51x and 540x speed up on ptweedie evaluations

  • Integrated in distributional and fable: dist_tweedie implements the standard distributional interface and works seamlessly with forecast(), accuracy().

Simple implementation in fable.intermittent

  # Fit ETS and TWEES models on training time series
  fit <- train |>
    model(ets = ETS(value), twees = TWEES(value))
  
  # Forecast one month (28 days) ahead
  fc <- fit |> forecast(h = 28)

  # Plot forecast and time series of brand B2 and SKU 19
  fc |> filter(Brand == "B2", SKU == 19) |>
    autoplot(train |> filter(Brand == "B2", SKU == 19, level = 90) +
    autolayer(test |> filter(Brand == "B2", SKU == 19), value)

Benchmark on Pasta dataset

Experimental setup: 118 time series, training on 1797 days

Models: all 10 available on fable.intermittent plus ETS

# Fit all models on the training data
fit_inter <- train |>
  model(
    ets = ETS(value),
    empdistr = EMPDISTR(value),
    staticdistr = STATICDISTR(value),
    betanbb = BETANBB(value),
    gampois = GAMPOISB(value),
    wss = WSS(value),
    vz = VZ(value),
    hspes = HSPES(value),
    negbines = NEGBINES(value),
    twees = TWEES(value),
    marwal = MARWAL(value)
  )

Benchmark on Pasta dataset

Forecast next month (28 days)

# Forecast the next 6 months
fc_inter <- fit_inter |> 
  forecast(h = 28)

Evaluation: Scaled Pinball Loss (SPL95), CRPS

acc_inter <- fc_inter |>
  accuracy(test_ts, 
  measures = list(
      SPL95=scaled_pinball_loss,
      CRPS=CRPS),
  .train = list(train_ts$value), 
  level=c(95))
.model SPL_95 CRPS
negbines 0.16 1.86
twees 0.16 1.88
staticdistr 0.17 1.86
hspes 0.17 2.05
marwal 0.18 2.16
betanbb 0.18 1.97
vz 0.18 1.86
empdistr 0.18 1.86
wss 0.18 1.87
gampois 0.21 2.94
ets 0.23 3.15

Reconciling mixed hierarchies

Pasta dataset: a hierarchy

118 SKU divided between 4 brands summing up to a total

pasta_hts <- pasta_tsibble |>
  aggregate_key(Brand / SKU, value = sum(value))

How to reconcile?

We cannot use Gaussian reconciliation (MinT): bottom are intermittent.

We need mixed type reconciliation.

Reconciliation via conditioning: bayesRecon

  • Base forecasts are incoherent with independent predictive distributions for each series.

  • Reconciliation via conditioning takes the joint incoherent distribution and conditions on the hierarchy constraints (\(\boldsymbol u = \boldsymbol{Ab}\)), keeping only coherent points.

  • Works for discrete, continuous and mixed-type predictive distributions

Implemented in R package bayesRecon: no forecast model fit, the user provides forecasts.

fable.bayesRecon

Implements reconciliation via conditioning into fable

  • Gaussian with unknown covariance (bayesRecon_t)
    Bayesian approach to account for the uncertainty of the covariance matrix. Student’s t reconciled distribution (Carrara et al. 2026)

  • Discrete forecasts (bayesRecon_BUIS)
    Bottom Up Importance Sampling: hierarchical constraints incorporated as sampling constraints (Zambon, Azzimonti, and Corani 2024)

  • Mixed type forecasts (bayesRecon_MixCond, bayesRecon_TDcond)
    Gaussian forecasts reconciled with MinT, discrete forecasts reconciled with bottom-up (MixCond) or top-down (TDcond) updates.(Zambon, Azzimonti, Rubattu, et al. 2024)

Reconciling the Pasta hierarchy

Hierarchy: 118 disaggregated time series, 4 mid-level aggregates, one top level.

# Fit base forecasting models
# base_mix -> bottom TWEES, rest ETS
fit <- train_hts |>
  model(ets = ETS(value), twees = TWEES(value)) |>
  mutate(base_mix = if_else(is_aggregated(SKU), ets, twees))

# reconcile forecasting models
# mixCond on base_mix
# MinT    on ETS
fit_rec <- fit |> reconcile(mixCond = bayesRecon_MixCond(base_mix),
                            MinT    = min_trace(ets))

# Forecast 28 steps ahead
n_test <- 28
fc <- fit_rec |> forecast(h = n_test)

Results of reconciled forecasts

Conclusions

Intermittent time series in fable framework

fable.intermittent and fable.bayesRecon

  • 10 probabilistic methods for intermittent time series implemented in fable environment

  • Easy benchmarking and new methods development

  • Tweedie distribution and TWEES model competitive with state of the art

  • All works seamlessly with reconciliation functions in fable.bayesRecon

Help needed! Add/propose new methods by posting an issue on Github

https://github.com/StefanoDamato/fable.intermittent/issues

Thanks for your attention

fable.intermittent

https://cran.r-project.org/package=fable.intermittent

fable.bayesRecon

https://cran.r-project.org/package=fable.bayesRecon

Bibliography

Boylan, John E., and M. Zied Babai. 2022. “Estimating the Cumulative Distribution Function of Lead-Time Demand Using Bootstrapping with and Without Replacement.” International Journal of Production Economics 252: 108586. https://doi.org/https://doi.org/10.1016/j.ijpe.2022.108586.
Carrara, Chiara, Dario Azzimonti, Giorgio Corani, and Lorenzo Zambon. 2026. Modeling the Uncertainty on the Covariance Matrix for Probabilistic Forecast Reconciliation. https://arxiv.org/abs/2506.19554.
Damato, Stefano, Dario Azzimonti, and Giorgio Corani. 2025. “Forecasting Intermittent Time Series with Gaussian Processes and Tweedie Likelihood.” International Journal of Forecasting, ahead of print. https://doi.org/10.1016/j.ijforecast.2025.10.001.
Dunn, Peter K., and Gordon K. Smyth. 2005. “Series Evaluation of Tweedie Exponential Dispersion Model Densities.” Statistics and Computing 15 (4): 267–80. https://doi.org/10.1007/s11222-005-4070-y.
Harvey, Andrew, and Cristiano Augusto Coelho Fernandes. 1989. “Time Series Models for Count or Qualitative Observations.” Journal of Business & Economic Statistics 7: 407–17. https://api.semanticscholar.org/CorpusID:122860918.
Mancuso, Paolo, Veronica Piccialli, and Antonio M. Sudoso. 2021. “A Machine Learning Approach for Forecasting Hierarchical Time Series.” Expert Systems with Applications 182: 115102. https://doi.org/https://doi.org/10.1016/j.eswa.2021.115102.
Sbrana, Giacomo. 2025. “Markov Walk and Walmart Sales Prediction.” Journal of the Operational Research Society 0 (0): 1–12. https://doi.org/10.1080/01605682.2025.2569661.
Syntetos, A. A., J. E. Boylan, and J. D. Croston. 2005. “On the Categorization of Demand Patterns.” Journal of the Operational Research Society 56 (5): 495–503.
Willemain, Thomas R., Charles N. Smart, and Henry F. Schwarz. 2004. “A New Approach to Forecasting Intermittent Demand for Service Parts Inventories.” International Journal of Forecasting 20 (3): 375–87. https://doi.org/https://doi.org/10.1016/S0169-2070(03)00013-X.
Zambon, Lorenzo, Dario Azzimonti, and Giorgio Corani. 2024. “Efficient Probabilistic Reconciliation of Forecasts for Real-Valued and Count Time Series.” Statistics and Computing 34 (1): 21. https://doi.org/10.1007/s11222-023-10343-y.
Zambon, Lorenzo, Dario Azzimonti, Nicolò Rubattu, and Giorgio Corani. 2024. “Probabilistic Reconciliation of Mixed-Type Hierarchical Time Series.” Proceedings of the Fortieth Conference on Uncertainty in Artificial Intelligence, 4078–95. https://proceedings.mlr.press/v244/zambon24a.html.
Zhou, Chenxi, and S. Viswanathan. 2011. “Comparison of a New Bootstrapping Method with Parametric Approaches for Safety Stock Determination in Service Parts Inventory Systems.” International Journal of Production Economics 133 (1): 481–85. https://doi.org/https://doi.org/10.1016/j.ijpe.2010.09.021.

Appendix

Models implemented

Method Description
BETANBB() Bayesian dynamic negative binomial model with a beta prior on the probability parameter.
EMPDISTR() Empirical resampling baseline that forecasts from the observed distribution.
GAMPOISB() Bayesian dynamic Poisson model with a gamma prior on the rate parameter.
HSPES() Exponential smoothing model with a hurdle-shifted Poisson forecast distribution.
MARWAL() ARMA model with a Markov walk on the occurrence and Gaussian forecast distribution.
NEGBINES() Exponential smoothing model with a negative binomial forecast distribution.
STATICDISTR() Static count-distribution model that selects among candidate distributions by AIC or BIC.
TWEES() Exponential smoothing model with a Tweedie forecast distribution.
VZ() Bootstrap method based on Croston decomposition sampling demand sizes and intervals.
WSS() Bootstrap method with sampled demand sizes and a Markov-chain for the occurrence.

Tweedie distribution

Member of the exponential dispersion family, parametrized by mean \(\mu>0\), dispersion \(\phi>0\), power \(p\in(1,2)\): \[\mathbb{E}[X]=\mu, \qquad \text{Var}(X) = \phi\,\mu^{p}\]

For power \(p \in (1,2)\) Tweedie has a compound Poisson-Gamma representation with

  • Point mass at zero: \[\mathbb{P}(X=0) = \exp\!\left(-\frac{\mu^{2-p}}{\phi(2-p)}\right)\]

  • For \(X>0\): density has no closed form but computable (Dunn and Smyth 2005)

Captures both “no demand” periods and a heavy right tail of spikes.

TWEES details

TWEES(formula, damped = TRUE, scaling = TRUE)

  • damped = TRUE (default): damped trend in the smoothing recursion;

  • scaling = TRUE (default): series rescaled by its max before fitting, for numerical stability

  • \(h=1\) forecast: exact Tweedie distribution; \(h>1\): obtained by simulating the recursion forward (no closed form, as in ETS prediction intervals)

  • Brings the Tweedie-likelihood idea (introduced in Damato et al. (2025) with Gaussian Processes) into a lightweight exponential smoothing model

fable.intermittent::ptweedie vs tweedie::ptweedie

  • Speed up depends on power and dispersion

  • Biggest speed up at low dispersion and high power

fable.intermittent::dtweedie vs tweedie::dtweedie

  • Speed up depends on power and dispersion