hanaml.Croston.Rdhanaml.Croston is a R wrapper for SAP HANA PAL Croston Exponential Smoothing algorithm.
hanaml.Croston( data, key = NULL, endog = NULL, alpha = NULL, forecast.num = NULL, method = NULL, accuracy.measure = NULL, ignore.zero = NULL, expost.flag = NULL )
| data |
|
|---|---|
| key |
|
| endog |
|
| alpha |
|
| forecast.num |
|
| method |
Defaults to "sporadic". |
| accuracy.measure |
No default value. |
| ignore.zero |
Only valid when |
| expost.flag |
Defaults to TRUE. |
Return a list of two DataFrame:
DataFrame 1
Forecast values.
DataFrame 2
Statistics analysis content.
The Croston method is a forecast strategy for products with intermittent demand.
The Croston method consists of two steps. First, separate
exponential smoothing estimates are made of the average size of a demand.
Second, the average interval between demands is calculated.
This is then used in a form of the constant model to predict the future demand.
Input DataFrame data:
> data$Collect() ID RAWDATA 1 0 0 2 1 1 3 2 4 4 3 0 5 4 0 6 5 0 7 6 5 8 7 3 9 8 0 10 9 0 11 10 0
Call the function:
> cesm <- hanaml.Croston(data = data,
alpha=0.1,
forecast.num=1,
method="sporadic",
accuracy.measure="mape")
Output:
> cesm[[2]]$Collect() STAT_NAME STAT_VALUE 1 MAPE 0.2432182