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
method of dealing with nonseasonal data that contains a trend,
particularly yearly data. The global linear trend is the simplest type of
polynomial curve. The Gompertz curve can be written in the following
format, where α, β, and γ are parameters with 0 < r < 1:
x t = αexp [β exp(−γt)]
This looks quite different but is actually equivalent, provided γ > 0. The
logistic curve is as follows:
x t = a / (1+be -ct )
Both these curves are S-shaped and approach an asymptotic value
as t→∞, with the Gompertz curve generally converging slower than the
logistic one. Fitting the curves to data may lead to nonlinear simultaneous
equations.
For all curves of this nature, the fitted function provides a measure
of the trend, and the residuals provide an estimate of local fluctuations
where the residuals are the differences between the observations and the
corresponding values of the fitted curve.
Removing Trends from a Time Series
Differentiating a given time series until it becomes stationary is a special
type of filtering that is particularly useful for removing a trend. You will
see that this is an integral part of the Box-Jenkins procedure. For data with
a linear trend, a first-order differencing is usually enough to remove the
trend.
Mathematically, it looks like this:
y(t) = a*t + c
y(t+1) = a*(t+1) + c
z(t) = y(t+1) –y(t) = a + c ; no trend present in z(t)
123