Introduction

Among forecasting techniques, smoothing techniques are used to remove erratic data patterns. Simple Exponential Smoothing is a technique applied in a time series wherein the data is smoothed based on a smoothing factor. Output is derived by combining each data point pro-rated using a smoothing parameter and preceding forecast. By including actual values and prior period forecasted values, the forecast generated by Simple Exponential Smoothing is better suited to provide output closer to the actual trends.

Formula

St=αyt+(1−α)St−1

St: Smoothed observation at time t

St−1: Smoothed observation immediately prior to time t

α: Smoothing parameter

yt: Data point at time t

Example

DAY

SALES

Forecast

Monday2525
Tuesday2825
Wednesday2725.3
Thursday2625.21
Friday2425.147
Saturday2325.1029
Sunday5825.07103

Key Considerations:

  • In the example above, the alpha value (α) is 0.3
  • The forecast value for the first day will be the same as the actual value
  • Changes in alpha value will significantly influence the forecasted

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

Snapshot of the data

Workflow Details

Within the KNIME platform, navigate to the dataset and extract the relevant columns essential for analysis. After data extraction, data grouping and refinement are carried out. Column “SubTotal” is the chosen candidate for Simple 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 the DB connector node and fed into KNIME via DB reader after choosing the appropriate relation and extracting the necessary primary candidate key.
  • SubTotal values are grouped by applying an aggregate function (SUM), and this grouping is based on month and year.

Forecasting

  • Execute a simple exponential smoothing methodology on the data present in the “SubTotal” column using a standard node.
  • Initialize variables that store different smoothing parameters. alpha values
  • Window size determines alpha values as per the formula, which is the KNIME standard.
    • α = 2/(k+1) ,  k is the window size
  • Alternatively, the entire calculation can be performed manually using “Column Expression” Node
  • Based on the degree of volatility of the data, different α values provide smoother forecasts that align with past patterns.

Visualization

WMA Output

*Blue : actual data points

*Green : forecasted value with α = 0.6

*Yellow : forecasted value with  α = 0.25

*Red : forecasted value with  α = 0.4

Forecast Accuracy

Following table compares the standard Root Mean Squared Error value for different alpha parameters.

Summary

  • Simple Exponential Smoothing, also referred to as Exponential Moving Average, is used to create smoothed data for time series data that lacks clear trends
  • A higher “α” increases responsiveness to recent actual data, while a lower α emphasizes prior smoothened forecast value
  • A lower RMSE indicates better accuracy and closer alignment between the forecasted values and the actual data.
  • In the sample above, with an alpha value of 0.25, the RMSE is the highest (50,787.734), suggesting that the forecasting model is not capturing the data’s underlying patterns well enough
  • An alpha value of 0.6 yields the lowest RMSE (22,384.288), indicating that the model is better at fitting the data with this parameter.
  • Smoothing techniques are applied prior to forecast activities
  • Iteratively simulating for multiple values of alpha(α ) is essential before finalizing the parameter with the best accuracy