forecast.tsint: Forecast from a fitted intermittent demand model

View source: R/forecast.R

forecast.tsintR Documentation

Forecast from a fitted intermittent demand model

Description

Point forecasts from a model fitted with crost, tsb, sexsm, crost.ma, or imapa, for any horizon, without optimising the model again. The fitted model can also be applied to new data.

Usage

## S3 method for class 'tsint'
forecast(object, h = NULL, newdata = NULL, ...)

Arguments

object

A fitted model, of class tsint.

h

Forecast horizon. If NULL, the horizon of the fitted model is used.

newdata

Optional time series to apply the fitted model to, for example the series updated with new observations. The parameters and initial values of the model are used without optimisation, see the section "Reusing a fitted model" in crost. If NULL, the forecasts are produced from the end of the series the model was fitted to.

...

Unused.

Details

This method gives only the point forecasts, i.e., the expected demand per period. For Croston's method and its variants, TSB, and iMAPA these are demand rates, constant over the horizon. No prediction intervals are provided. For these methods a predictive distribution is meaningful only for the demand over the lead time, not for the demand of each period, so per-period intervals would be misleading. Note that the parameters of a model optimised with the cost functions "msce" or "mace" depend on the horizon used when fitting it, and they are not reoptimised for a new h.

Everything else is available in the native functions of the package:

  • quantiles of the demand over the lead time and the safety stock, with the input probs of the forecasting functions, e.g., crost(y, h=3, probs=c(0.9,0.95))$lt, or for an existing fitted model, for any lead time and probabilities, without refitting, with lt.dist, e.g., lt.dist(fit, h=3, probs=0.95);

  • plots of the forecasts per period and over the lead time, with plot.tsint and plot.imapa;

  • the parameters and a summary of the model, with coef and summary, see tsint-methods;

  • the fitted model applied to new data, keeping its smoothing parameters but optimising its initial values, with the input model of the forecasting functions and init.opt=TRUE, e.g., crost(y, model=fit, init.opt=TRUE).

Value

A vector of point forecasts of length h. If the series was a ts object, the forecasts are a ts object continuing its time index.

Author(s)

Nikolaos Kourentzes, nikolaos@kourentzes.com

See Also

lt.dist, crost.

Examples

fit <- crost(window(ts.data1, end=c(1985,12)), type="sba")

# Point forecasts for a different horizon
forecast(fit, h=6)

# The fitted model applied to the updated series
forecast(fit, h=6, newdata=ts.data1)

# Quantiles of the demand over a lead time of 3 periods, in the native way
lt.dist(fit, h=3, probs=c(0.9,0.95))


tsintermittent documentation built on Nov. 14, 2026, 5:06 p.m.