hanaml.TripleExponentialSmoothing.Rd
hanaml.TripleExponentialSmoothing is a R wrapper for SAP HANA Triple Exponential Smoothing algorithm.
hanaml.TripleExponentialSmoothing(
data,
key = NULL,
endog = NULL,
alpha = NULL,
beta = NULL,
gamma = NULL,
seasonal.period = NULL,
forecast.num = NULL,
seasonal = NULL,
initial.method = NULL,
phi = NULL,
damped = NULL,
accuracy.measure = NULL,
ignore.zero = NULL,
expost.flag = NULL,
level.start = NULL,
trend.start = NULL,
season.start = NULL,
prediction.confidence.1 = NULL,
prediction.confidence.2 = NULL
)
DataFrame
DataFrame containting the data.
character, optional
Name of the ID column.
Defaults to the first column if not provided.
character, optional
The endogenous variable, i.e. time series.
Defaults to the first non-ID column.
double, optional
Weight for smoothing. Value range: 0 < alpha < 1.
Defaults to 0.1.
double, optional
Weight for the trend component. Value range: 0 <= beta < 1.
Defaults to 0.1.
double, optional
Weight for the seasonal component. Value range: 0 < gamma < 1.
Defaults to 0.1.
integer, optional
Length of a seasonal.period (L > 1).
For example, the seasonal.period of quarterly data is 4,
and the seasonal.period of monthly data is 12.
Defaults to 2.
integer, optional
Number of values to be forecast.
Defaults to 0.
integer, optional
0: Multiplicative triple exponential smoothing.
1: Additive triple exponential smoothing.
When seasonal
is set to 1, the default value of initial.method is 1;
When seasonal
is set to 0, the default value of initial.method is 0.
Defaults to 0.
integer, optional
Initialization method for the trend and seasonal components.
When seasonal
is set to 1, the default value of initial.method is 1;
When seasonal
is set to 0, the default value of initial.method is 0.
double, optional
Value of the damped smoothing constant phi (0 < phi < 1).
Defaults to 0.1.
logical, optional
FALSE: Uses the Holt Winter method.
TRUE: Uses the additive damped seasonal Holt Winter method.
Defaults to FALSE.
character or list of characters, optional
Specifies the method of accuracy evaluation.
mpe
: Mean percentage error.
mse
: Mean squared error.
rmse
: Root mean squared error.
et
: Error total.
mad
: Mean absolute deviation.
mase
: Out-of-sample mean absolute scaled error.
wmape
: Weighted mean absolute percentage error.
smape
: Symmetric mean absolute percentage error.
mape
: Mean absolute percentage error.
No default value.
logical, optional
FALSE: Uses zero values in the input dataset when calculating "mpe" or "mape".
TRUE: Ignores zero values in the input dataset when calculating "mpe" or "mape".
Only valid when accuracy.measure
is "mpe" or "mape".
Defaults to FALSE.
logical, optional
FALSE: Does not output the expost forecast, and just outputs the forecast values.
TRUE: Outputs the expost forecast and the forecast values.
Defaults to TRUE.
double, optional
The initial value for level component S. If this value is not provided,
it will be calculated in the way as described in Triple Exponential Smoothing.level.start
cannot be zero. If it is set to zero, 0.0000000001 will be used instead.
double, optional
The initial value for trend component B.
No default value.
list of tuples, optional
A list of initial values for seasonal component C.
Two values must be provided for each cycle:
Cycle ID: An int which represents which cycle the initial value is used for.
Initial value: A double precision number which represents the initial value
for the corresponding cycle.
For example: To give the initial value 0.5 to the 3rd cycle,
insert list(tuple(3, 0.5)) into the parameter table.
No default value.
double, optional
Prediction confidence for interval 1.
Only valid when the upper and lower columns are provided in the result table.
Defaults to 0.8.
double, optional
Prediction confidence for interval 2.
Only valid when the upper and lower columns are provided in the result table.
Defaults to 0.95.
Returns a list of two DataFrames:
DataFrame 1
Forecast values.
DataFrame 2
Statistics analysis content.
Triple Exponential smoothing is used to handle the time series data containing a seasonal component.
Input DataFrame data:
> data$Collect()
ID RAWDATA
1 1 362
2 2 385
3 3 432
......
22 22 725
23 23 854
24 24 661
Call the function:
> tesm <- hanaml.TripleExponentialSmoothing(data = data,
alpha=0.822,
beta=0.055,
gamma=0.055,
seasonal.period=4,
forecast.num=6,
seasonal=0,
initial.method=0,
phi=NULL,
damped=NULL,
accuracy.measure="mse",
ignore.zero=NULL,
expost.flag=TRUE,
level.start=NULL,
trend.start=NULL,
season.start=NULL,
prediction.confidence.1=0.8,
prediction.confidence.2=0.95)
Output:
> tesm[[2]]$Collect()
STAT_NAME STAT_VALUE
1 MSE 616.5415