Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

croston

Forecasts for intermittent demand using Croston's method


Description

Returns forecasts and other information for Croston's forecasts applied to y.

Usage

croston(y, h = 10, alpha = 0.1, x = y)

Arguments

y

a numeric vector or time series of class ts

h

Number of periods for forecasting.

alpha

Value of alpha. Default value is 0.1.

x

Deprecated. Included for backwards compatibility.

Details

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. The smoothing parameters of the two applications of SES are assumed to be equal and are denoted by alpha.

Note that prediction intervals are not computed as Croston's method has no underlying stochastic model.

Value

An object of class "forecast" is a list containing at least the following elements:

model

A list containing information about the fitted model. The first element gives the model used for non-zero demands. The second element gives the model used for times between non-zero demands. Both elements are of class forecast.

method

The name of the forecasting method as a character string

mean

Point forecasts as a time series

x

The original time series (either object itself or the time series used to create the model stored as object).

residuals

Residuals from the fitted model. That is y minus fitted values.

fitted

Fitted values (one-step forecasts)

The function summary is used to obtain and print a summary of the results, while the function plot produces a plot of the forecasts.

The generic accessor functions fitted.values and residuals extract useful features of the value returned by croston and associated functions.

Author(s)

Rob J Hyndman

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.

See Also

ses.

Examples

y <- rpois(20,lambda=.3)
fcast <- croston(y)
plot(fcast)

forecast

Forecasting Functions for Time Series and Linear Models

v8.14
GPL-3
Authors
Rob Hyndman [aut, cre, cph] (<https://orcid.org/0000-0002-2140-5352>), George Athanasopoulos [aut], Christoph Bergmeir [aut] (<https://orcid.org/0000-0002-3665-9021>), Gabriel Caceres [aut], Leanne Chhay [aut], Mitchell O'Hara-Wild [aut] (<https://orcid.org/0000-0001-6729-7695>), Fotios Petropoulos [aut] (<https://orcid.org/0000-0003-3039-4955>), Slava Razbash [aut], Earo Wang [aut], Farah Yasmeen [aut] (<https://orcid.org/0000-0002-1479-5401>), R Core Team [ctb, cph], Ross Ihaka [ctb, cph], Daniel Reid [ctb], David Shaub [ctb], Yuan Tang [ctb] (<https://orcid.org/0000-0001-5243-233X>), Zhenyu Zhou [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.