Modelling & Forecasting Time-Series data has been one of the cornerstones of Predictive Analytics in the era of Big Data. There are a plethora of forecasting techniques available today whose context can be a pain to understand and as we know, in the war on noise, context serves as a crucial ammunition. To that end, we, Hemanth Sindhanuru & Srinidhi K, from LatentView Analytics are presenting this series of articles where we will be discussing a structured methodology to understand, analyse & forecast time-series data
Until now, we have explored time-series modelling in a generic sense. We have discussed the conceptual bases on which some of the popular approaches for modelling time-series are built and attributes which capture the underlying structural characteristics of a time-series. We now move on to the modelling techniques themselves. We start with Exponential Smoothing which is one of the fundamental time-series modelling techniques that is popular for its simplicity & low computational cost
This approach is built on the fundamental assumption that any particular observation of a time-series is related to (in other words, a function of) it’s past observations i.e. the observations preceding it. The models under the exponential smoothing framework involve defining an observation in the time-series as a weighted average of its past observations, with the weights decaying exponentially as the observations get older, hence the name exponential

As we see in a generic mathematical representation of the idea, a particular observation at time T+1 is a weighted average of all the preceding observations at times T, T-1, T-2, …, 2, 1 in the series and the rate at which the weights decay exponentially is controlled by the smoothing parameter represented by, which varies between 0 & 1.
SIMPLE EXPONENTIAL SMOOTHING
We start by looking at the simplest model in the framework which builds on the above assumption of exponentially decreasing weights. This model doesn’t take into account any seasonal or trend effects and hence, is suitable for application on time-series with very weak Seasonality & Trend. ( For a quantitative measure of these attributes, please refer the previous article in the series )
Defining the Modelling Equation
Drawing from the aforementioned idea, a generic observation of a time-series can be represented as follows

The notation can be simplified further in the following way;

Computing the model parameters
To provide closure for the series, every model under the ETS framework requires an initialization of the first observation of the series.

The aforementioned assignment is not the only option for initializing the model. We can also set the value to the mean of the series, among other alternatives.
Once initialized, the next step involves the calculation of the parameter, α. To choose the optimum value for the parameter, we follow an approach similar to that of in Multiple Linear Regression. We select a loss function like the Sum of Squared Errors (SSE) and

select the optimum value of the parameter, alpha which minimizes the loss function.
EXTENDING THE SIMPLE ETS MODEL TO ACCOUNT FOR SEASONALITY & TREND
Though the use-cases of the Simple ETS model are limited due to the presence of a Seasonal or Trend component in most of the series under consideration, understanding the steps in the computation of the model provides us a stepping stone for the more complex models in the framework. To expand the scope of the Simple ETS model to time-series’ with Seasonality & Trend attributes, these components are characterized explicitly through separate equations which are characterized by their own independent parameters. Consider the following example

As we see, the seasonal & trend components are represented by explicit equations which are characterized by the parameters, β & γ. The computation of the model parameters involves an identical procedure for each of the explicit equations; Initializing, Selecting a Loss function & Optimizing the parameters with respect to the loss function.
TAXONOMY OF THE ETS MODELS
The flexibility of the ETS framework lies in its ability to model Seasonality & Trend components of different natures in a generic way. Let’s examine the multiplicative seasonality version of the Holt Winters model shown below;br/>

Considering the following variants of each of the time-series’ components; 2 for the Remainder, 5 for the Trend & 3 for the Seasonality shown below;

we have a framework of 30 ETS models ( 2 x 5 x 3 combinations )
IMPLEMENTATION IN R
require(datasets)
require(forecast)
?ets
dataset <- UKgas
plot(dataset)
ETS_model ets ( y = dataset, model = "ZZZ" )
plot( ETS_model )
OUTPUT


Once we represent the time-series under consideration with a mathematical model, we move on to forecasting the time-series values for future horizons. There are two approaches to forecasting for multiple horizons in general