19 Exponential Smoothing
Learn about the Exponential Smoothing algorithm.
19.1 About Exponential Smoothing
Exponential smoothing is a forecasting method for time series data. It is a moving average method where exponentially decreasing weights are assigned to past observations.
Exponential smoothing methods have been widely used in forecasting for over half a century. A forecast is a prediction based on historical data and patterns. preIt 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 wellknown approaches, such as the BoxJenkins autoregressive integrated moving average (ARIMA) approach. Oracle Machine Learning for SQL implements exponential smoothing using a state of the art state space method that incorporates a single source of error (SSOE) assumption which provides theoretical and performance advantages.

A matrix of models that mix and match error type (additive or multiplicative), trend (additive, multiplicative, or none), and seasonality (additive, multiplicative, or none)

Models with damped trends.

Models that directly handle irregular time series and time series with missing values.

Multiple time series models
See Also:
Ord, J.K., et al, Time Series Forecasting: The Case for the Single Source of Error State Space Approach, Working Paper, Department of Econometrics and Business Statistics, Monash University, VIC 3800, Australia, April 2, 2005.
19.1.1 Exponential Smoothing Models
Exponential Smoothing models are a broad class of forecasting models that are intuitive, flexible, and extensible.
Members of this class include simple, single parameter models that predict the future as a linear combination of a previous level and a current shock. Extensions can include parameters for linear or nonlinear trend, trend damping, simple or complex seasonality, related series, various forms of nonlinearity in the forecasting equations, and handling of irregular time series.
Exponential smoothing assumes that a series extends infinitely into the past, but that influence of past on future, decays smoothly and exponentially fast. The smooth rate of decay is expressed by one or more smoothing constants. The smoothing constants are parameters that the model estimates. The assumption is made practical for modeling real world data by using an equivalent recursive formulation that is only expressed in terms of an estimate of the current level based on prior history and a shock to that estimate dependent on current conditions only.The procedure requires an estimate for the time period just prior to the first observation, that encapsulates all prior history. This initial observation is an additional model parameter whose value is estimated by the modeling procedure.
Components of ESM such as trend and seasonality extensions, can have an additive or multiplicative form. The simpler additive models assume that shock, trend, and seasonality are linear effects within the recursive formulation.
19.1.2 Simple Exponential Smoothing
Simple exponential smoothing assumes the data fluctuates around a stationary mean, with no trend or seasonal pattern.
In a simple Exponential Smoothing model, each forecast (smoothed value) is computed as the weighted average of the previous observations, where the weights decrease exponentially depending on the value of smoothing constant α. Values of the smoothing constant, α, near one, put almost all weight on the most recent observations. Values of α near zero allows the distant past observations to have a large influence.
19.1.3 Models with Trend but No Seasonality
The preferred form of additive (linear) trend is sometimes called Holt’s method or double exponential smoothing.
Models with trend add a smoothing parameter γ and optionally a damping parameter φ. The damping parameter smoothly dampens the influence of past linear trend on future estimates of level, often improving accuracy.
19.1.4 Models with Seasonality but No Trend
When the time series average does not change over time (stationary), but is subject to seasonal fluctuations, the appropriate model has seasonal parameters but no trend.
Seasonal fluctuations are assumed to balance out over periods of length m, where m is the number of seasons, For example, m=4 might be used when the input data are aggregated quarterly. For models with additive errors, the seasonal parameters must sum to zero. For models with multiplicative errors, the product of seasonal parameters must be one.
19.1.5 Models with Trend and Seasonality
Holt and Winters introduced both trend and seasonality in an Exponential Smoothing model.
The original model, also known as HoltWinters or triple exponential smoothing, considered an additive trend and multiplicative seasonality. Extensions include models with various combinations of additive and multiplicative trend, seasonality and error, with and without trend damping.
19.1.6 Prediction Intervals
To compute prediction intervals, an Exponential Smoothing (ESM) model is divided into three classes.
The simplest class is the class of linear models, which include, among others, simple ESM, Holt’s method, and additive HoltWinters. Class 2 models (multiplicative error, additive components) make an approximate correction for violations of the Normality assumption. Class 3 modes use a simple simulation approach to calculate prediction intervals.
19.2 Data Preparation for Exponential Smoothing Models
Prepare your data for exponential smoothing by providing input data, aggregation methods, and model build parameters.
To build an ESM model, you must supply the following :

Input data

An aggregation level and method, if the case id is a date type

Partitioning column, if the data are partitioned
In addition, for a greater control over the build process, the user may optionally specify model build parameters, all of which have defaults:

Model

Error type

Optimization criterion

Forecast Window

Confidence level for forecast bounds

Missing value handling

Whether the input series is evenly spaced
Related Topics
See Also:
DBMS_DATA_MINING —Algorithm Settings: Exponential Smoothing Models for a listing and explanation of the available model settings.
Note:
The term hyperparameter is also interchangeably used for model setting.19.2.1 Input Data
Time series analysis requires ordered input data. Hence, each data row must consist of an [index, value] pair, where the index specifies the ordering.
When you create an Exponential Smoothing (ESM) model using the CREATE_MODEL
or the CREATE_MODEL2
procedure, the CASE_ID_COLUMN_NAME
and the TARGET_COLUMN_NAME
parameters are used to specify the columns used to compute the input indices and the observed time series values, respectively. The time column bears Oracle number, or Oracle date, timestamp, timestamp with time zone, or timestamp with local time zone. When the case id column is of type Oracle NUMBER
, the model considers the input time series to be equally spaced. Only the ordinal position matters, with a lower number indicating a later time. In particular, the input time series is sorted based on the value of case_id
(time label). The case_id column cannot contain missing values. To indicate a gap, the value column can contain missing values as NULL
. The magnitude of the difference between adjacent time labels is irrelevant and is not used to calculate the spacing or gap size. Integer numbers passed as CASE_ID
are assumed to be nonnegative.
ESM also supports partitioned models and in such cases, the input table contains an extra column specifying the partition. All [index, value] pairs with the same partition ID form one complete time series. The Exponential Smoothing algorithm constructs models for each partition independently, although all models use the same model settings.
Data properties may result in a warning notice, or settings may be disregarded. If the user sets a model with a multiplicative trend, multiplicative seasonality, or both, and the data contains values Y_{t}<= 0, the model type is set to default. If the series contains fewer values than the number of seasons given by the user, then the seasonality specifications are ignored and a warning is issued.
If the user has selected a list of predictor series using the parameter EXSM_SERIES_LIST
, the input data can also include up to twenty additional time series columns.
Related Topics
19.2.2 Accumulation
Use accumulation procedures for datetype columns to generate equally spaced time series data.
For the Exponential Smoothing algorithm, the accumulation procedure is
applied when the column is a date type (date
,
datetime
, timestamp
, timestamp with
timezone
, or timestamp with local timezone
). The case id
can be a NUMBER
column whose sort index represents the position of the
value in the time series sequence of values. The case id column can also be a date type.
A date type is accumulated in accordance with a user specified accumulation window.
Regardless of type, the case id is used to transform the column into an equally spaced
time series. No accumulation is applied for a case id of type NUMBER
.
As
an example, consider a time series about promotion events.
The time column contains the
date of each event, and the dates can be unequally spaced. The user must specify the
spacing interval, which is the spacing of the accumulated or transformed equally spaced
time series. In the example, if the user specifies the interval to be month, then an
equally spaced time series with profit for each calendar month is generated from the
original time series. Setting EXSM_INTERVAL
is used to specify the
spacing interval. The user must also specify a value for
EXSM_ACCUMULATE
, for example, EXSM_ACCU_MAX
, in
which case the equally spaced monthly series would contain the maximum profit over all
events that month as the observed time series value.
19.2.3 Missing Value
Handle missing values effectively in your time series data for reliable exponential smoothing models.
NULL
entry
in the target column indicates a missing value. When the time column is of the type
datetime, the accumulation procedure can also introduce missing values. The setting
EXSM_SETMISSING
can be used to specify how to handle missing
values. The special value EXSM_MISS_AUTO
indicates that, if the series
contains missing values it is to be treated as an irregular time series.
Note:
Missing value handling setting must be compatible with model setting, otherwise an error is thrown.
19.2.4 Prediction
Specify the prediction window for your exponential smoothing model to generate accurate forecasts.
Setting EXSM_PREDICTION_STEP
can be used to specify the
prediction window. The prediction window is expressed in terms of number of intervals
(setting EXSM_INTERVAL
), when the time column is of the type datetime.
If the time column is a number then the prediction window is the number of steps to
forecast. Regardless of whether the time series is regular or irregular,
EXSM_PREDICTION_STEP
specifies the prediction window.
See Also:
Oracle Database PL/SQL Packages and Types Reference for a listing and explanation of the available model settings.Note:
The term hyperparameter is also interchangeably used for model setting.19.2.5 Parallellism by Partition
Enhance performance by processing time series data in parallel, using partitioning for efficient model building.
For example, a user can choose PRODUCT_ID
as one partition
column and can generate forecasts for different products in a model build. Although a
distinct smoothing model is built for each partition, all partitions share the same
model settings. For example, if setting EXSM_MODEL
is set to
EXSM_SIMPLE
, all partition models will be simple Exponential
Smoothing models. Time series from different partitions can be distributed to different
processes and processed in parallel. The model for each time series is built serially.
19.2.6 Initial Value Optimization
Optimize initial values for long seasonal cycles for improved performance.
This is in contrast to standard ESM optimization, in which the initial values are adjusted during the optimization process to minimize error. Optimizing only the level, trend, and seasonality parameters rather than the initial values can result in significant performance improvements and faster optimization convergence. When domain knowledge indicates that long seasonal variation is a significant contributor to an accurate forecast, this approach is appropriate. Despite the performance benefits, Oracle does not recommend disabling the optimization of the initial values for typical short seasonal cycles because it may result in model overfitting and less reliable confidence bounds.
Related Topics
19.3 Multiple Time Series Models
Multiple time series is a convenience operation for constructing 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. All of the time series output is produced for the target. The other time series are assumed to be correlated with the target. This operation produces backcasts and forecasts on each time series and computes upper and lower confidence bounds for the identified target series. This operation can be used to forecast a wide variety of events, such as rainfall, sales, and customer satisfaction.
In the example of weather forecasting, the temperature and humidity attributes can be considered as the dependent or correlated time series and rainfall can be identified as the target time series.
Related Topics
19.3.1 Backcasts in Time Series
In the rainfall, temperature, and humidity multiple time series example, backcasts are the estimate produced by the model for historical data.
For example, if rainfall is dependent on humidity, then it is useful to have a value of humidity for the period of interest. For periods that have already occurred and are being used to construct the model, such as last week, it is necessary to have the humidity from last week and not from last month.
19.3.2 How to Build Multiple Time Series Models
Oracle's exponential smoothing is enhanced to handle the building of multiple time series models with a single call to the model build method, in addition to single time series forecasting.
Multiple time series is built by specifying a series list
EXSM_SERIES_LIST
. The rest of the parameters are the same as in
ESM model. In the weather forecast example, you can have a build data set and a
score data set. The build data set contains the identified target series (rain), the
dependent series: temperature and humidity. The DM$VP
model detail
view is used to display a forecast for the identified target series (rain), along
with dependent series: temperate, and humidity. The DM$VR
model
detail view is used to display backcasts for target series (rain), humidity, and
temperature. The backcasts and forecasts of the time series model can be fed into a
regression technique like generalized linear model, neural network, or XGBoost for time series regression.
In the
following example, the target attribute DAX is a Stock market index that is being
forecast. The dependent attributes that are also popular stock market indexes  SMI,
CAC, FTSE are passed as multiple series attributes. Exponential Smoothing settings
are used to build a multiple time series model by specifying a series list
(EXSM_SERIES_LIST
) with multiple attributes.
19.4 Time Series Regression
Enhance time series regression with multiseries build by including additional features or related series to improve accuracy.
Time series regression is possible with the multiseries build. Time series regression expands the features that can be included in a time series model and possibly improves forecast accuracy. Some of the additional features can be other time series that are thought to be related or dependent to the "target" series. Temperature and humidity are both dependent time series with rainfall, so by looking at historical data for these two attributes, we can make predictions about future rainfall. When the temperature is high and the humidity is high, there is a greater chance of rainfall.
A time series regression model will take into account the relationship between temperature and humidity, as well as other factors (for example, the location and elevation of the forecast location). The model then produces a prediction for the amount of rainfall (the target series), along with upper and lower bounds. For example, if the model predicts that there is a 90% chance of rain, and the upper bound for the amount of rainfall is 1 inch, then you might want to make sure that you have enough rain gear on hand.
Backcasts can be used to possibly improve the accuracy of forecasts for future time periods. The challenge with using regression to forecast is that the predictors' future values must be given. If, for example, temperature and humidity are the predictors, you need to know their future values on the same time scale as the rainfall series to make a forecast.
Related Topics
See Also:
Hyndman, R.J. and Athanasopoulos, G., Forecasting: Principles and Practice, 3rd edition, Department of Econometrics and Business Statistics, Monash University, VIC 3800, Australia, May 2021, Chapter 7
19.4.1 How to Build Time Series Regression Models
Oracle exponential smoothing solves the problem of knowing future values on the same time scale as the target series by forecasting the predictor time series using exponential smoothing.
To build a regression model that predicts a future period, the correlated series must have a value in that future period. Hence, all correlated series must be forecast. Backcasts are included for the correlated series as smoothed versions of the correlated series values that can be used as input to the regression model. Backcasts are also available for the target series, as these are part of the standard output of an Oracle machine learning time series model. Target series backcasts can also be included in the regression model.
You can also create build and score datasets. The build data set contains the target series (forecast series), for example, rain; the backcasted target series, for example, backcasted rain; and the backcasted dependent series, for example, backcasted temperature and humidity. The backcasts and forecasts of the time series models can both be used as input to the regression model. The series all use the same time periods, so that the values of the target and the predictors cooccur.
The score data set follows the same schema as the build data set but provides forecasts as required for future values. The score data set can be supplied to the apply procedure of the regression model. Backcasts can be smoother and more structurally consistent with forecasts. The incremental improvement of the regression model over the baseline model can be seen in the backcast of the target series.
Because of the database's versatility, different time series regression variations are possible. A user can add factors such as holidays and environmental changes to the build and score data sets that account for categorical variables. In multiple time series regression, flag variables can be used to account for events or conditions that may have a significant impact on the dependent variable. For example, you might use a flag variable to indicate whether a particular day is a public holiday, or whether a particular month is a winter month. The inclusion of such factors in the model can improve the accuracy of the forecast by accounting for the impact of categorical variables on the dependent variable.
Holidays can be expressed as a binary value column (0s and
1s). For example, a national_holiday
column can be
made that has a value of 1 for national holidays and a value of 0 at
other times. In a demand forecast, a perceived change in the
environment, like the introduction of a competitor's product, can
also be shown as a binary value column, with 0 for times before the
introduction and 1 for times after.
Furthermore, as a special case, if a user happens to know the future values of the dependent series, a user could replace the backcasts with the original values in the regression build procedure by creating a data set that joins to the original build table. This usercreated data set replaces the build data set.
In the following example, a training, actual, and a test
data sets are created using the stock market data. A special case of
actual values are provided in the prediction data set to compare the
accuracy of ESM and regression. The variable prod
is a flag variable that accounts for categorical values. It
indicates a change in the environment such as an introduction of a
new product. The DM$VR<model_name>
model
detail view provides details of the time series regression build
schema or the forecast of the target column.
Related Topics