09.10.2023 Views

Advanced Data Analytics Using Python_ With Machine Learning, Deep Learning and NLP Examples ( 2023)

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6

Time Series

A trend can be exponential as well. In this case, you will have to do a

logarithmic transformation to convert the trend from exponential to linear.

Mathematically, it looks like this:

y(t) = a*exp(t)

z(t) = log(y(t)) = t*log(a); z(t) is a linear function of t

Analyzing a Series Containing Seasonality

Many time series, such as airline passenger loads or weather readings,

display variations that repeat after a specific time period. For instance, in

India, there will always be an increase in airline passenger loads during

the holiday of Diwali. This yearly variation is easy to understand and can

be estimated if seasonality is of direct interest. Similarly, like trends, if you

have a series such as 1, 2, 1, 2, 1, 2, your obvious choices for the next values

of the series will be 1 and 2.

The Holt-Winters model is a popular model to realize time series with

seasonality and is also known as exponential smoothing. The Holt-Winters

model has two variations: additive and multiplicative. In the additive

model with a single exponential smoothing time series, seasonality is

realized as follows:

X(t+1) = α ∗Xt + (1 − α) ∗ St−1

In this model, every point is realized as a weighted average of the

previous point and seasonality. So, X(t+1) will be calculated as a function

X(t-1) and S(t-2) and square of α. In this way, the more you go on, the

α value increases exponentially. This is why it is known as exponential

smoothing. The starting value of St is crucial in this method. Commonly,

this value starts with a 1 or with an average of the first four observations.

The multiplicative seasonal model time series is as follows:

X(t+1)= (b1 + b2*t)St + noise,

124

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!