Moving average with Croston's method decomposition for intermittent demand series with fixed or optimised parameters.
crost.ma(data,h=10,w=NULL,nop=c(2,1),type=c("croston","sba","sbj"),
cost=c("mar","msr","mae","mse"),outplot=c(FALSE,TRUE),
na.rm=c(FALSE,TRUE))
Type of model fitted.
In-sample demand rate.
Out-of-sample demand rate.
Moving averages orders for demand and interval.
List of c.in and c.out containing the non-zero demand and interval vectors for in- and out-of-sample respectively. Third element is the coefficient used to scale demand rate for sba and sbj.
Intermittent demand time series.
Forecast horizon.
Moving average order. If w == NULL then moving average orders are optimised. If w is a single value then the same order is used for smoothing both the demand and the intervals. If two values are provided then the second is used to smooth the intervals.
Specifies the number of model parameters. Used only if they are optimised. 1. 1 - Demand and interval moving average order are the same; 2. 2 - Different demand and interval orders.
Croston's method variant: 1. "croston" Croston's method; 2. "sba" Syntetos-Boylan approximation; 3. "sbj" Shale-Boylan-Johnston.
Cost function used for optimisation: 1. "mar" - Mean Absolute Rate; 2. "msr" - Mean Squared Rate; 3. "mae" - Mean Absolute Error; 4. "mse" - Mean Squared Error.
If TRUE a plot of the forecast is provided.
A logical value indicating whether NA values should be remove using the method.
Nikolaos Kourentzes
Optimisation cost functions described in: N. Kourentzes, 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").
crost
, tsb
, sexsm
.
crost.ma(ts.data1,outplot=TRUE)
Run the code above in your browser using DataLab