hanaml.DoubleExponentialSmoothing is a R wrapper for SAP HANA PAL Double Exponential Smoothing algorithm.

hanaml.DoubleExponentialSmoothing(
  data,
  key = NULL,
  endog = NULL,
  alpha = NULL,
  beta = NULL,
  forecast.num = NULL,
  phi = NULL,
  damped = NULL,
  accuracy.measure = NULL,
  ignore.zero = NULL,
  expost.flag = NULL,
  prediction.confidence.1 = NULL,
  prediction.confidence.2 = NULL
)

Arguments

data

DataFrame
DataFrame containting the data.

key

character, optional
Name of the ID column.
Defaults to the first column if not provided.

endog

character, optional
The endogenous variable, i.e. time series.
Defaults to the first non-ID column.

alpha

double, optional
Weight for smoothing. Value range: 0 < alpha < 1.
Defaults to 0.1.

beta

double, optional
Weight for the trend component. Value range: 0 <= beta < 1.
Defaults to 0.1.

forecast.num

integer, optional
Number of values to be forecast.
Defaults to 0.

phi

double, optional
Value of the damped smoothing constant phi (0 < phi < 1).
Defaults to 0.1.

damped

logical, optional

  • FALSE: Uses the Holt Winter method.

  • TRUE: Uses the additive damped seasonal Holt Winter method

Defaults to FALSE.

accuracy.measure

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.

ignore.zero

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.

expost.flag

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.

prediction.confidence.1

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.

prediction.confidence.2

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.

Value

Returns a list of two DataFrames:

  • DataFrame 1
    Forecast values.

  • DataFrame 2
    Statistics analysis content.

Details

Double Exponential Smoothing model is suitable to model the time series with trend but without seasonality.
In the model there are two kinds of smoothed quantities: smoothed signal and smoothed trend.

Examples

Input DataFrame data:


> data$Collect()
   ID RAWDATA
1   1     143
2   2     152
3   3     161
......
21 21     223
22 22     242
23 23     239
24 24     266

Call the function:


> desm <- hanaml.DoubleExponentialSmoothing(data = data,
                                            alpha=0.501,
                                            beta=0.072,
                                            forecast.num=6,
                                            phi=NULL,
                                            damped=NULL,
                                            accuracy.measure="mse",
                                            ignore.zero=NULL,
                                            expost.flag=TRUE,
                                            prediction.confidence.1=0.8,
                                            prediction.confidence.2=0.95)

Output:


> desm[[2]]$Collect()
  STAT_NAME    STAT_VALUE
1       MSE      274.896