Skip to contents

Croston's method (1972) and its variants for series where most periods have no demand: "sba" (Syntetos & Boylan, 2005) removes Croston's upward bias; "tsb" (Teunter, Syntetos & Babai, 2011) smooths the probability of demand, so the rate falls while nothing is sold. The forecast is the same for every horizon.

Usage

model_croston(
  variant = c("croston", "sba", "tsb"),
  alpha = NULL,
  beta = NULL,
  optimised = FALSE
)

Arguments

variant

"croston", "sba" or "tsb".

alpha

Smoothing of the demand sizes and intervals (default 0.1).

beta

Smoothing of the probability of demand, for TSB (default: alpha).

optimised

Choose alpha by the squared error of the rate.

Value

A model specification, to use with fit_model(), forecast_model() or backtest().

Examples

demand <- c(0, 0, 3, 0, 0, 0, 2, 0, 0, 4, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0)
forecast_model(model_croston("sba"), demand, h = 3)
#> [1] 0.8762393 0.8762393 0.8762393