Time Series -Exponential Smoothing

A technique for time series forecasting known as exponential smoothing gives historical observations weights that decrease exponentially with time. It is predicated on the idea that more current observations than older ones can predict behavior in the future. This method works especially well with datasets that lack seasonality or an obvious pattern.

The smoothing parameter, commonly represented as (alpha), is the fundamental component of exponential smoothing. The value of this parameter establishes how quickly the weight of earlier data fades. Recent observations are given greater weight when the value is higher, whereas historical data is given more weight when the value is lower.

Dataset

The carbon dioxide data obtained from the Mauna Loa Observatory, famously referred to as the "Keeling Curve," stands as the most extensive and uninterrupted record of atmospheric carbon dioxide levels globally. Researchers conduct atmospheric measurements in distant areas to capture air samples that accurately represent a significant portion of Earth's atmosphere and are less affected by local factors.

Code:

Now for a better understanding of this Exponential Smoothing, we will try to estimate the amount of air pollution (CO2) one month later.

Importing Libraries

Reading the Dataset

Output:

Time Series -Exponential Smoothing

Output:

Time Series -Exponential Smoothing

Output:

5
 

Output:

0
 

Output:

Time Series -Exponential Smoothing

Split the Dataset

Output:

Time Series -Exponential Smoothing

Time Series Structural Analysis

Now we will create a function that will do time series decomposition using the seasonal decomposition of time series (STL) method. It decomposes the time series into its trend, seasonality, and residual components, and also conducts a Dickey-Fuller test to determine the stationarity of the time series.

Output:

Time Series -Exponential Smoothing

Single Exponential Smoothing

Single Exponential Smoothing (SES), also known as Simple Exponential Smoothing, is a technique used for forecasting time series data that lacks trend or seasonality components. It involves a single parameter known as alpha (?), which is also referred to as the smoothing factor or coefficient. Alpha dictates the rate at which the influence of past observations diminishes exponentially. Typically, alpha is assigned a value between 0 and 1, where larger values prioritize recent data, while smaller values consider a broader historical context for predictions.

Output:

Time Series -Exponential Smoothing

Model Tuning - Single Exponential Smoothing

Output:

Time Series -Exponential Smoothing

Double Exponential Smoothing

Double Exponential Smoothing is a technique derived from Exponential Smoothing, tailored to accommodate trends within univariate time series data. In addition to the alpha parameter, which governs the smoothing factor for the level, Double Exponential Smoothing introduces another parameter known as beta (b). This parameter serves to regulate the decay of the trend's influence over time. The method is versatile, and capable of handling various types of trend changes, such as additive and multiplicative trends, corresponding to linear and exponential trends, respectively. When applied with an additive trend, it is commonly referred to as Holt's linear trend model, named after its creator, Charles Holt. It is essential to note that for longer-term forecasts, the trend may persist unrealistically. Thus, damping the trend over time can be a valuable strategy to mitigate this issue.

Output:

Time Series -Exponential Smoothing

Model Tuning - Double Exponential Smoothing

Output:

Time Series -Exponential Smoothing

Triple Exponential Smoothing

Triple Exponential Smoothing, also known as Holt-Winters Exponential Smoothing, is an advanced technique extending Exponential Smoothing to accommodate seasonality within univariate time series data. Named after its contributors, Charles Holt and Peter Winters, this method introduces a new parameter called gamma (g) alongside the alpha and beta smoothing factors. Gamma controls the influence of the seasonal component, allowing for the modeling of seasonality as either additive or multiplicative processes. Additive seasonality corresponds to linear seasonality, while multiplicative seasonality aligns with exponential seasonality. Triple Exponential Smoothing stands as the most sophisticated variant of exponential smoothing, capable of developing double and single exponential smoothing models through configuration.

Output:

Time Series -Exponential Smoothing

Model Tuning - Triple Exponential Smoothing

Output:

Time Series -Exponential Smoothing

TES Final Prediction

Output:

Time Series -Exponential Smoothing