plot.tsint: Plot intermittent demand forecasts

View source: R/tsint.R

plot.tsintR Documentation

Plot intermittent demand forecasts

Description

Plot the forecasts produced by crost, tsb, sexsm, and crost.ma, in two views: per period or over the lead time.

Usage

## S3 method for class 'tsint'
plot(x, view = c("period", "leadtime"), legend = TRUE, ...)

Arguments

x

An object of class tsint.

view

The view to plot:

  • "period": the series, with the in-sample and out-of-sample demand rate. When lead time quantiles are available, each quantile is shown divided by the lead time, spread over the forecast horizon. This places the quantile next to the forecast, but it is not a per-period quantile.

  • "leadtime": the rolling cumulative demand over windows of h periods, plotted at the end of each window, and the cumulative forecasts made at the start of each window. When lead time quantiles are available, the in-sample cumulative forecasts plus the empirical error quantiles are shown as well, and the cumulative forecast and quantiles for the next h periods are marked at the end of the forecast horizon. This is the view in which the predictive distribution is defined. It needs h of at least 1.

legend

If TRUE, a legend is added when it is needed.

...

Additional arguments passed to plot, for example main, xlab, ylab, and ylim.

Value

No return value, called for the plot.

Author(s)

Nikolaos Kourentzes, nikolaos@kourentzes.com

See Also

crost, plot.imapa.

Examples

fit <- crost(ts.data1, h=3, type="sba", probs=c(0.9,0.95))
plot(fit)
plot(fit, view="leadtime")
plot(fit, view="leadtime", main="SBA", ylab="Demand over 3 periods")

# The lead time view is also available without quantiles
plot(tsb(ts.data1, h=6), view="leadtime")


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