6.9 Exponential Smoothing Model
The ore.odmESM class uses the in-database Exponential Smoothing Model (ESM) algorithm to create a clustering model.
               
Exponential Smoothing Methods have been widely used in forecasting for over half a century. It has applications at the strategic, tactical, and operation level. For example, at a strategic level, forecasting is used for projecting return on investment, growth and the effect of innovations. At a tactical level, forecasting is used for projecting costs, inventory requirements, and customer satisfaction. At an operational level, forecasting is used for setting targets and predicting quality and conformance with standards.
In its simplest form, Exponential Smoothing is a moving average method with a single parameter which models an exponentially decreasing effect of past levels on future values. With a variety of extensions, Exponential Smoothing covers a broader class of models than other well-known approaches, such as the Box-Jenkins auto-regressive integrated moving average (ARIMA) approach. The in-database Exponential Smoothing algorithm uses a state of the art state space method that incorporates a single source of error (SSOE) assumption which provides theoretical and performance advantages.
Multiple time series is a convenience operation for constructing input to a time series regression. Multiple time series builds multiple time series models with a common time interval for use as input to a time series regression. One of the time series models is identified as the target time series of interest. For more information about Multiple Time Series Models, see Oracle Machine Learning for SQL Concepts Guide.
The behavior of Exponential Smoothing is modified such that it searches for an acceptable time series model automatically. If you do not specify a model type (EXSM_MODEL), the default behavior is for the algorithm to automatically determine the model type. For more information, see Oracle Machine Learning for SQL Concepts Guide.
                  
Settings for an ESM model
The following table lists settings that apply to ESM models.
Table 6-8 ESM Model Settings
| Setting Name | Setting Value | Description | 
|---|---|---|
| EXSM_MODEL | One of {EXSM_SIMPLE, EXSM_SIMPLE_MULT, EXSM_HOLT, EXSM_HOLT_DMP, EXSM_MUL_TRND, EXSM_MULTRD_DMP, EXSM_SEAS_ADD, EXSM_SEAS_MUL, EXSM_HW, EXSM_HW_DMP, EXSM_HW_ADDSEA, EXSM_DHW_ADDSEA, EXSM_HWMT, EXSM_HWMT_DMP} | This setting specifies the model. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 The default value is  | 
| 
 | 
 | This setting specifies a positive integer value as the length of seasonal cycle. The value specified must be larger than  This setting is only applicable and must be provided for models with seasonality, otherwise the model throws an error. When  | 
| 
 | One of {EXSM_INTERVAL_YEAR, EXSM_INTERVAL_QTR, EXSM_INTERVAL_MONTH,EXSM_INTERVAL_WEEK, EXSM_INTERVAL_DAY, EXSM_INTERVAL_HOUR, EXSM_INTERVAL_MIN,EXSM_INTERVAL_SEC} | This setting only applies and must be provided when the time column ( The model throws an error if the time column of input table is of datetime type and setting  The model throws an error if the time column of input table is of oracle number type and setting  | 
| 
 | One of {EXSM_ACCU_TOTAL, EXSM_ACCU_STD, EXSM_ACCU_MAX, EXSM_ACCU_MIN, EXSM_ACCU_AVG, EXSM_ACCU_MEDIAN, EXSM_ACCU_COUNT} | This setting only applies and must be provided when the time column has datetime type. It specifies how to generate the value of the accumulated time series from the input time series. | 
| 
 | One of {EXSM_MISS_MIN, EXSM_MISS_MAX, EXSM_MISS_AVG, EXSM_MISS_MEDIAN, EXSM_MISS_LAST, EXSM_MISS_FIRST, EXSM_MISS_PREV, EXSM_MISS_NEXT, EXSM_MISS_AUTO}. | This setting specifies how to handle missing values, which may come from input data and/or the accumulation process of time series. You can specify either a number or an option. If a number is specified, all the missing values are set to that number. 
 
 
 
 
 
 
 
 
 If this setting is not provided,  | 
| 
 | An integer in the range  Default value: 1. | This setting specifies how many steps ahead the predictions are to be made. If it is not set, the default value is  | 
| 
 | A number in the range  | This setting specifies the desired confidence level for prediction. The lower and upper bounds of the specified confidence interval is reported. If this setting is not specified, the default confidence level is 0.95. | 
| EXSM_OPT_CRITERION  | One of {EXSM_OPT_CRIT_LIK, EXSM_OPT_CRIT_MSE, EXSM_OPT_CRIT_AMSE, EXSM_OPT_CRIT_SIG, EXSM_OPT_CRIT_MAE}. | This setting specifies the desired optimization criterion. The optimization criterion is useful as a diagnostic for comparing models' fit to the same data. 
 
 
 
 
 The default value is  | 
| 
 | 
 | This setting specifies the length of the window used in computing the error metric average mean square error (AMSE). | 
| 
 Note:Available only in Oracle AI Database 26ai. | Comma delimited list of time series columns | This setting allows you to forecast up to twenty predictor series in addition to the target series. The column names in  For the prefix  | 
| 
 Note:Available only in Oracle AI Database 26ai. | 
 
 | The setting EXSM_INITVL_OPTIMIZEdetermines whether initial values are optimized during model build. The default value isEXSM_INITVL_OPTIMIZE_ENABLE.Note: EXSM_INITVL_OPTIMIZEcan only be set toEXSM_INITVL_OPTIMIZE_DISABLEif the user has setEXSM_MODELtoEXSM_HWorEXSM_HW_ADDSEA. IfEXSM_MODELis set to another model type or is not specified, error 40213 (conflicting settings) is thrown and the model is not built. | 
Example 6-8 Using the ore.odmESM Function
This example pushes the data frame iris: to a temporary database table IRIS and creates Exponential Smoothing model.
# Turn off row ordering warnings.
options(ore.warn.order=FALSE)
# Data setup
set.seed(7654)
N <- 100
dat <- data.frame(ID=1:N, VAL=runif(N))
# Create the a temporary OML4R proxy object DAT.
DAT <- ore.push(dat)
# Create an ESM regression model object. Fit the ESM model according to the data and setting parameters.
esm.mod  <- ore.odmESM(VAL ~ ., DAT,
    odm.settings = list(case_id_column_name = "ID",
                        exsm_prediction_step = 4))
    
esm.mod
summary(esm.mod)Listing for This Example
Settings:                                                 
                                                               value 
         confidence.level                                        .95 
         model                                                 imple 
         nmse                                                      3
         optimization.crit                              opt.crit.lik
         prediction.step                                           4
         setmissing                                        miss.auto
         odms.details                                    odms.enable
         odms.missing.value.treatment        odms.missing.value.auto
         odms.sampling                         odms.sampling.disable
         prep.auto                                                ON
Call: ore.odmESM(formula = VAL ~ ., data = DAT, odm.settings = list(case_id_column_name = "ID", exsm_prediction_step = 4))Predictions:
      CASE_ID      VALUE PREDICTION        LOWER   UPPER
  1         1 0.68847989  0.5414108         NA      NA
  2         2 0.63346191  0.5414255         NA      NA 
  3         3 0.34073466  0.5414347         NA      NA
  4         4 0.41106593  0.5414146         NA      NA 
  5         5 0.17601063  0.5414016         NA      NA
  6         6 0.82879446  0.5413650         NA      NA
  7         7 0.23504359  0.5413938         NA      NA
  8         8 0.14222260  0.5413631         NA      NA 
  9         9 0.76561760  0.5413232         NA      NA 
  10       10 0.90813842  0.5413457         NA      NA 
  11       11 0.59706210  0.5413823         NA      NA 
  12       12 0.44463468  0.5413879         NA      NA 
  13       13 0.95294541  0.5413782         NA      NA 
  14       14 0.58209937  0.5414194         NA      NA
  15       15 0.62295773  0.5414235         NA      NA
  16       16 0.59711650  0.5414316         NA      NA
  17       17 0.41131782  0.5414372         NA      NA
  18       18 0.79952871  0.5414242         NA      NA
  19       19 0.12635680  0.5414500         NA      NA
  20       20 0.04773946  0.5414085         NA      NA