hanaml.LRSeasonalAdjust.Rdhanaml.LRSeasonalAdjust is a R wrapper for SAP HANA PAL Linear regression with damped trend and seasonal adjust.
hanaml.LRSeasonalAdjust( data, key, endog = NULL, forecast.length = NULL, trend = NULL, affect.future.only = NULL, seasonality = NULL, seasonal.period = NULL, accuracy.measure = NULL, seasonal.handle.method = NULL, expost.flag = NULL, ignore.zero = NULL )
| data |
|
|---|---|
| key |
|
| endog |
|
| forecast.length |
|
| trend |
|
| affect.future.only |
Defaults to TRUE. |
| seasonality |
Defaults to 0. |
| seasonal.period |
|
| accuracy.measure |
No default value. |
| seasonal.handle.method |
Defaults to "average". |
| expost.flag |
Defaults to TRUE. |
| ignore.zero |
Defaults to FALSE. |
Returns a list of two DataFrames:
DataFrame 1
Forecast values.
DataFrame 2
Statistics analysis content.
Input DataFrame data:
> data$Collect() TIMESTAMP Y 1 1 5328.172 2 2 7701.608 3 3 11248.606 4 4 9478.945 5 5 6138.471 6 6 8829.956 7 7 2838.390
Invoke the function:
> lr <- hanaml.LRSeasonalAdjust(data,
key = "TIMESTAMP",
endog = "Y",
forecast.length = 1,
trend = 0.9,
affect.future.only = TRUE,
seasonality = 2,
seasonal.handle.method = "lr",
accuracy.measure = list("mape", "mpe"),
expost.flag = TRUE,
ignore.zero = TRUE)
Ouput:
> lr[[1]]$Collect() TIMESTAMP VALUE 1 1 8472.320 2 2 8103.649 3 3 7734.978 4 4 7366.307 5 5 6997.636 6 6 6628.965 7 7 6260.294 8 8 5928.490 > lr[[2]]$Collect() STAT_NAME STAT_VALUE 1 Intercept 8840.9904286 2 Slope -368.6708929 3 MAPE 0.3960495 4 MPE -0.1719060 5 HandleZero 0.0000000