hanaml.SingleExponentialSmoothing {hana.ml.r}R Documentation

Single Exponential Smoothing

Description

hanaml.SingleExponentialSmoothing is a R wrapper for PAL Single Exponential Smoothing algorithm.

Usage

hanaml.SingleExponentialSmoothing(conn.context,
                                  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)

Arguments

conn.context

ConnectionContext
The connection to the SAP HANA system.

data

DataFrame
DataFrame containing the data.

key

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

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.

delta

double, optional
Value of weighted for At and Mt. Only valid when 'adaptive_method' is TRUE. Defaults to 0.2.

forecast.num

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

adaptive.method

logical, optional
- FALSE: Single exponential smoothing
- TRUE: Adaptive-response-rate single exponential smoothing
Defaults to FALSE.

accuracy.measure

character or list of characters, optional
Specifies measure name.

  • 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.

Details

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.

Value

Return a list of two DataFrame:

Examples

## Not run: 
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

> sesm <- hanaml.SingleExponentialSmoothing(conn.context,
                                            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

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]