Introduction

In time series forecasting, there are two methods to Double Exponential Smoothing unlike only one for Single Exponential Smoothing. First method is Double Exponential Moving Average (DEMA) and second one is Holt-Winters Double Exponential Smoothing. Both approaches help in smoothing the pattern and aid in predicting future values based on past data. Both methods have different approaches, and this blog explores both DEMA and Holt-Winters methods conceptually and implementation considerations.

Holt-winters Double Exponential Smoothing

Holt Winters method extends the concept of simple exponential smoothing to account for both a Trend and the Level of the data. It employs two smoothing factors, one for the level (α – alpha) and another for the trend (β – beta).

Holt-Winters double exponential smoothing Formula:

  • Level at time ‘t’ (Lt):

           Lt = α * Xt + (1 – α) * (Lt-1 + Tt-1)

  • Trend at time ‘t’ (Tt):

          Tt = β * (Lt – Lt-1) + (1 – β) * Tt-1

  • Forecasting

          Yt+1 = Lt + Tt

Xt: The actual value of the time series at time ‘t’.

α: Smoothing parameter for the level (0 < α < 1).

β: Smoothing parameter for the trend (0 < β < 1).

Lt-1: Smoothed level at the previous time period.

Tt-1: Smoothed trend at the previous time period.

Yt+1 : Forecasted value at time t+1

Example Holt-winters Double Exponential Smoothing

Month

Rates

Lt

Tt

Yt+1

Jan9.75
Feb10.0910.090.34
Mar10.2710.320.2710.43
Apr8.989.46-0.4010.59
May8.798.87-0.529.06
June8.238.27-0.578.35
Jul8.248.08-0.347.70
Aug8.978.600.187.74
Sept9.038.950.288.78
Oct9.319.290.319.24

Double Exponential Moving Average ( DEMA )

Double Exponential Moving Average (DEMA) extends the standard Single Exponential Smoothing by applying the Exponential Moving Average (EMA) values twice. Two levels of EMA applied on the data set provides better smoothened and accurate forecasts.

DEMA Formula

  • Double_exponential_n = 2 * EMA(v,n) – EMA(EMA(v,n),n)
  • EMA(v,n) = Simple_exponential_n = alpha*v_n + (1-alpha)* Simple_exponential_n-1

Double Exponential Moving Average Example

Month

Rates

Forecasted Value

Jan9.759.75
Feb10.099.862
Mar10.2710.005
Apr8.989.682
May8.799.38
June8.238.974
Jul8.248.68
Aug8.978.71
Sept9.038.759
Oct9.318.8993

Dataset Information

The sample dataset from the Industry schema is as follows, with a focus on the “salesorderheader” relation.

Field

Type

Candidate Variable

OrderIDCharacter
CustomerIDInteger
ShipDateTimestamp
SalespersonemployeeIDInteger
ShipMethodIDInteger
TerritoryIDInteger
SubTotalNumeric

Number of records : 1561

Candidate keys

Number of unique values

Max Value

Min Value

Subtotal623129,261.2542.29
ShipDate6752014-05-012011-06-01

Workflow

Within the KNIME platform, navigate to the dataset and extract the relevant columns essential for analysis. Subsequent to data extraction, data grouping and refinement is carried out. Column “SubTotal” is the chosen candidate for Double Exponential Smoothing calculations. Upon computing the smoothed forecasts, a graphical depiction adeptly showcases the original and forecasted data outcomes along with the calculations for forecast accuracy.

Reading & Manipulating Data

  • The data is read via DB connector node and fed into KNIME via DB reader after choosing appropriate relation and extracting the necessary primary candidate key.
  • SubTotal (i.e. measure) values are grouped by applying an aggregate function (SUM), and this grouping is based on month and year.

Forecasting

  • Execute the Double exponential smoothing methodology on the data present in the “SubTotal” column using standard node.
  • Window size determines alpha values for the DEMA method, which is KNIME standard.
    • α = 2/(k+1) ,  k is the window size
  • Alternatively, the entire calculation for Holt-Winter method can be performed by executing a database procedure using “DB Query Executer”
  • Based on the degree of volatility of the data, different α values provide smoother forecasts that align with past patterns.
  • Numeric Scorer node is used to calculate the root mean square error (RMSE) value to find the average error between the predicted and actual values.

Visualization

*Blue : Actual Data points

*Green : DEMA Forecasted values

*Yellow : Holt-Winter Forecasted values

Forecast Accuracy

Following table compares the standard Root Mean Squared Error value for the two methods Holt-Winter and DEMA.

Summary

  • Alpha and Beta (Smoothing parameters) can be controlled in Holt-Winter method and adjusted to get better accuracy
  • Alpha value can be controlled in DEMA by selecting appropriate window length
  • A higher “α” increases responsiveness to recent actual data, while a lower α emphasizes on longer time period value
  • A lower RMSE indicates better accuracy and closer alignment between the forecasted values and the actual data
  • Alpha parameter is common for both methods, whereas Beta is applicable only for Holt Winter method

Authors

  • VedhashreeU
  • Kaptain