hanaml.IntermittentForecast.RdThis function is a wrapper for PAL Intermittent Time Series Forecast (ITSF), which is a new forecast strategy for products with intermittent demand.
hanaml.IntermittentForecast( data, key, endog = NULL, p = NULL, q = NULL, forecast.num = NULL, optimizer = NULL, method = NULL, grid.size = NULL, optimize.step = NULL, accuracy.measure = NULL, ignore.zero = NULL, expost.flag = NULL, thread.ratio = NULL )
| data |
|
|---|---|
| key |
|
| endog |
|
| p |
The specified value cannot exceed the length of time-series for analysis. |
| q |
Defaults to -1. |
| forecast.num |
|
| optimizer |
Defaults to "lbfgsb_default". |
| method |
Defaults to "constant". |
| grid.size |
|
| optimize.step |
|
| accuracy.measure |
|
| ignore.zero |
Only valid when |
| expost.flag |
Defaults to TRUE. |
| thread.ratio | numeric, optional
Defaults to 0. |
A list of two DataFrames.
forecasts: DataFrame that stores the forecast values.
stats: DataFrame that stores the related statistics.
Difference to constant weight of the Croston's method:
ITSF provides a exponential weight to estimate, which means the closer the data, the greater the weight.
ITSF does not need the initial value of non-zero demands and time interval between non-zero demands.
Time-series data for intermittent forecast:
> data
ID RAWDATA
1 0 0.0
2 1 1.0
3 2 4.0
4 3 0.0
5 4 0.0
6 5 0.0
7 6 5.0
8 7 3.0
9 8 0.0
10 9 0.0
11 10 0.0
Apply intermittent forecast to the given time-series data:
> res <- hanaml.IntermittentForecast(data = data,
key = "ID",
p = 3,
forecast.num = 3,
optimizer = "lbfgsb_grid",
grid.size = 20,
optimize.step = 0.011,
expost.flag = FALSE,
accuracy.measure = "mse",
ignore.zero = FALSE,
thread.ratio = 0.5)
Check the ouput DataFrames:
> res$forecasts ID RAWDATA 1 12 2.831169 2 13 2.831169 3 14 2.831169
> res$stats
STAT_NAME STAT_VALUE
1 MSE 10.650383
2 LAST_DEMAND 3.892857
3 LAST_INTERVAL 0.000000
4 OPT_P 3.000000
5 OPT_Q 0.000000
6 OPT_STATE 0.000000