hanaml.SingleExponentialSmoothing.Rd
hanaml.SingleExponentialSmoothing is a R wrapper for SAP HANA PAL Single Exponential Smoothing algorithm.
hanaml.SingleExponentialSmoothing(
data,
key = NULL,
endog = NULL,
alpha = NULL,
delta = NULL,
forecast.num = NULL,
adaptive.method = NULL,
accuracy.measure = NULL,
ignore.zero = NULL,
expost.flag = 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 when adaptive.method
is not TRUE, 0.2 otherwise.
double, optional
Value of weight for At and Mt.
Only valid when adaptive.method
is TRUE.
Defaults to 0.2.
integer, optional
Number of values to be forecast.
Defaults to 0.
logical, optional
FALSE: Single exponential smoothing.
TRUE: Adaptive-response-rate single exponential smoothing.
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
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.
Return a list of two DataFrames:
DataFrame 1
Forecast values.
DataFrame 2
Statistics analysis content.
Single Exponential Smoothing model is suitable to model the time series without trend and seasonality.
In the model, the smoothed value is the weighted sum of previous smoothed value and previous observed value.
PAL provides two simple exponential smoothing algorithms: single exponential smoothing
and adaptive-response-rate simple exponential smoothing.
The adaptive-response-rate single exponential smoothing algorithm may have an advantage
over single exponential smoothing in that it allows the value of alpha to be modified.
Input DataFrame data:
> data$Collect()
ID RAWDATA
1 1 200.0
2 2 135.0
3 3 195.0
4 4 197.5
5 5 310.0
6 6 175.0
7 7 155.0
8 8 130.0
9 9 220.0
10 10 277.5
11 11 235.0
Call the function:
> sesm <- hanaml.SingleExponentialSmoothing(alpha = 0.1,
delta = 0.2,
forecast.num = 12,
adaptive.method = FALSE,
accuracy.measure = list("MPE", "MSE"),
ignore.zero = TRUE,
expost.flag = TRUE,
prediction.confidence.1 = 0.8,
prediction.confidence.2 = 0.95)
Output:
> sesm[[2]]$Collect()
STAT_NAME STAT_VALUE
1 MPE -0.05117142
2 MSE 3438.33212531