Learn R Programming

tsintermittent (version 1.10)

imapa: MAPA for intermittent demand data

Description

MAPA for intermittent demand data with automatic model selection based on the PK classification.

Usage

imapa(data,h=10,w=NULL,minimumAL=1,maximumAL=NULL,comb=c("mean","median"),
      init.opt=c(TRUE,FALSE),paral=c(0,1,2),outplot=c(0,1,2,3,4),model.fit=NULL,
      na.rm=c(FALSE,TRUE))

Value

frc.in

In-sample demand rate.

frc.out

Out-of-sample demand rate.

summary

An array containing information for each aggregation level: AL - Aggregation level; n - Number of observations of aggregated series; p - Average inter-demand interval; cv2 - Coefficient of variation squared of non-zero demand; model - Selected model, where 1 is Croston, 2 is SBA and 3 is SES; use - If == 0 then this aggregation level is ignored because it contains less than 4 observations.

model.fit

Parameters and initialisation values of fitted model in each aggregation level.

Arguments

data

Intermittent demand time series.

h

Forecast horizon.

w

Smoothing parameters. If w == NULL then parameters are optimised. If w is w single parameter then the same is used for smoothing both the demand and the intervals. If two parameters are provided then the second is used to smooth the intervals. SES is always optimised.

minimumAL

Lowest aggregation level to use. Default = 1.

maximumAL

Highest aggregation level to use. Default = maximum interval.

comb

Combination operator. One of "mean" or "median". Default is "mean".

init.opt

If init.opt==TRUE then Croston and SBA initial values are optimised.

paral

Use parallel processing. 0 = no; 1 = yes (requires initialised cluster); 2 = yes and initialise cluster. Default is 0.

outplot

Optional plot: 0 = No plot; 1 = Time series and combined forecast; 2 = Time series and all aggregation level forecasts; 3 = Summary model selection plot; 4 = Detailed model selection plot.

model.fit

Optional input with model types and parameters. This is the model.fit output from this function. If used it overrides other model settings.

na.rm

A logical value indicating whether NA values should be remove using the method.

Author

Nikolaos Kourentzes

References

Optimisation of the methods described in: F. Petropoulos and N. Kourentzes, 2015, Forecast Combinations for Intermittent Demand, Journal of Operational Research Society. https://link.springer.com/article/10.1057/jors.2014.62.

https://kourentzes.com/forecasting/2014/05/13/forecast-combinations-for-intermittent-demand/

See Also

tsb, sexsm, crost, idclass.

Examples

Run this code
imapa(ts.data1,outplot=1)

Run the code above in your browser using DataLab