Time series forecasting — Smoothing models

Sangarshanan
4 min readSep 6, 2018

Average method:

The future prediction is the average of the all historical data. This is not true for most of the cases

Moving average method:

The future prediction is the average of defined number of time periods. This is pretty similar to average method except that we do not consider all of historical data, we can choose to use only the recent ones. This is also not accurate

Naive method:

All predictions are the value of the last observation. These methods are used when starting a time series and when there is not enough

Seasonal naive methods:

This method is like the naive method but predicts the last observed value of the same season of the year. This method works for highly seasonal data.

Before diving into sophisticated algorithms it is necessary to plot the time series data to gain intuition and even make direct predictions

There are several trends that occur in time series analysis, they are seasonal trends(increase or decrease at equal intervals and are associated with some aspect of the calendar) and cyclical ( increase or decrease at irregular intervals) cyclical trends can be observed in stock market where bull market is uptrend and bear market represents the downtrend. Cyclical patterns are tough to predict as they are could be very random.

Simple Exponential smoothing

Exponential smoothing uses the weighted average of previous observations where more weight is given to the most recent observations and the weight decreases as observations get older.

For simple exponential smoothing methods, the forecast is calculated by multiplying past values by relative weights, which are calculated based upon what is termed a smoothing parameter. You’ll also hear this called the alpha or α. This is the magnitude of the weight applied to the previous values, with the weights decreasing exponentially as the observations get older. The formula looks like this:

Forecast = Weightt Yt + Weightt-1 Yt-1 + Weightt-2 Yt-2 + … + (1-α)n Yn

where, t is the number of time periods before the most recent period (e.g. t = 0 for the most recent time period, t = 1 for the time period before that).Yt = actual value of the time series in period t

Weightt = α(1-α)t

n = the total number of time periods

This model basically gives us a smooth line or LEVEL in our forecast that we can use to forecast the next period.

Choosing the correct smoothing parameter is often an iterative process and can be simplified by using advanced statistical tools

The simple exponential smoothing method does not account for any trend or seasonal components, rather, it only uses the decreasing weights to forecast future results. This makes the method suitable only for time series without trend and seasonality.

Reference:

https://github.com/Sangarshanan/Time-Series-Forecasting/blob/master/Simple%20Exponential%20Smoothing.ipynb

We can extend the simple exponential method to forecast data with trend and seasonality. ETS denotes how the error, trend, and seasonality are applied to the smoothing to forecast values accurately

Trend(centered moving average of the series) season(seasonal changes) and error(DIFFERENCE BETWEEN THE OBSERVED VALUE AND THE TREND LINE ESTIMATE) plots can be plotted by decomposition of the original time series plot.

Decide whether a time series exhibits additive or multiplicative behavior relies on our ability to see the ETS patterns

Additive: Trend and seasonal variations are relatively constant. Suppose the sales increase by $100 every year in January then we just add $100 to the prediction. This is additive (linear curve)

Multiplicative: Trend and seasonal variations either increase or decrease over time. Suppose the sales increase by a factor of 50% every year then we multiply by a factor of 1.5 making it multiplicative (exponential curve )

Holt’s Linear Trend Method

This method is also called double exponential smoothing and it captures the trend by adding a second exponential model. This causes the forecasts to trend upward or downward linearly depending on the trend rather than staying flat. This is a great model to apply for any non-seasonal dataset

Reference: https://github.com/Sangarshanan/Time-Series-Forecasting/blob/master/Holts%20linear%20trend%20method.ipynb

Exponential trend method

A variation of Holt’s method wherein the trend increases/decreases exponentially instead of changing linearly.

Damped trend methods

Sometimes when the forecast horizon is long, the trend based methods tend to over-forecast as the trend continues to be extrapolated into the future. To overcome this bottleneck, we can introduce a parameter that dampens the trend line in the future(phi). Smaller parameter value assumes that the model changes slowly over time and vice versa.

Holts winters seasonal method

This method has three smoothing equations for level, trend, and the seasonal component. Additive method is used when the seasonal fluctuations don't change over time, otherwise, the multiplicative method is used.

Holts winters seasonal method can be used with a damping parameter and is one of the most widely used method for seasonal data

--

--