Learn R Programming

fable (version 0.3.3)

CROSTON: Croston's method

Description

Based on Croston's (1972) method for intermittent demand forecasting, also described in Shenstone and Hyndman (2005). Croston's method involves using simple exponential smoothing (SES) on the non-zero elements of the time series and a separate application of SES to the times between non-zero elements of the time series.

Usage

CROSTON(
  formula,
  opt_crit = c("mse", "mae"),
  type = c("croston", "sba", "sbj"),
  ...
)

Value

A model specification.

Arguments

formula

Model specification (see "Specials" section).

opt_crit

The optimisation criterion used to optimise the parameters.

type

Which variant of Croston's method to use. Defaults to "croston" for Croston's method, but can also be set to "sba" for the Syntetos-Boylan approximation, and "sbj" for the Shale-Boylan-Johnston method.

...

Not used.

Specials

demand

The demand special specifies parameters for the demand SES application.


demand(initial = NULL, param = NULL, param_range = c(0, 1))

initialThe initial value for the demand application of SES.
paramThe smoothing parameter for the demand application of SES.
param_rangeIf param = NULL, the range of values over which to search for the smoothing parameter.

interval

The interval special specifies parameters for the interval SES application.


interval(initial = NULL, param = NULL, param_range = c(0, 1))

initialThe initial value for the interval application of SES.
paramThe smoothing parameter for the interval application of SES.
param_rangeIf param = NULL, the range of values over which to search for the smoothing parameter.

Details

Note that forecast distributions are not computed as Croston's method has no underlying stochastic model. In a later update, we plan to support distributions via the equivalent stochastic models that underly Croston's method (Shenstone and Hyndman, 2005)

There are two variant methods available which apply multiplicative correction factors to the forecasts that result from the original Croston's method. For the Syntetos-Boylan approximation (type = "sba"), this factor is \(1 - \alpha / 2\), and for the Shale-Boylan-Johnston method (type = "sbj"), this factor is \(1 - \alpha / (2 - \alpha)\), where \(\alpha\) is the smoothing parameter for the interval SES application.

References

Croston, J. (1972) "Forecasting and stock control for intermittent demands", Operational Research Quarterly, 23(3), 289-303.

Shenstone, L., and Hyndman, R.J. (2005) "Stochastic models underlying Croston's method for intermittent demand forecasting". Journal of Forecasting, 24, 389-402.

Kourentzes, N. (2014) "On intermittent demand model optimisation and selection". International Journal of Production Economics, 156, 180-190. tools:::Rd_expr_doi("10.1016/j.ijpe.2014.06.007").

Examples

Run this code
library(tsibble)
sim_poisson <- tsibble(
  time = yearmonth("2012 Dec") + seq_len(24),
  count = rpois(24, lambda = 0.3),
  index = time
)

sim_poisson %>%
  autoplot(count)

sim_poisson %>%
  model(CROSTON(count)) %>%
  forecast(h = "2 years") %>%
  autoplot(sim_poisson)

Run the code above in your browser using DataLab