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

Now, E[X(t)] is the expected value of X(t).

Covariance(X(t),X(t+h)) = E[(X(t) - E[X(t)]) * (X(t+h) – E[X(t+h)])]

= E[(X(t) - m) * (X(t+h) - m)]

If X(t) is a weak stationary process, then:

E[X(t)] = E[X(t+h)] = m (constant)

= E[X(t) * X(t+h)] – m 2 = c(h)

Here, m is constant, and cov[X(t),X(t+h)] is the function of only h(c(h))

for the weakly stationary process. c(h) is known as autocovariance.

Similarly, the correlation (X(t),X(t+h) = ρ(h) = r(h) = c(h) = ¸ c(0) is

known as autocorrelation.

If X(t) is a stationary process that is realized as an autoregressive

model, then:

X(t) = a1 * X(t-1) + a2 * X(t-2) + ….. + ap * X(t-p) + Z(t)

Correlation(X(t),X(t)) = a1 * correlation (X(t),X(t-1)) + …. +

ap * correlation (X(t),X(t-p))+0

As covariance, (X(t),X(t+h)) is dependent only on h, so:

r0 = a1 * r1 + a2 * r2 + … + ap * rp

r1 = a1 * r0 + a2 * r1 + …. + ap * r(p-1)

So, for an n-order model, you can easily generate the n equation and

from there find the n coefficient by solving the n equation system.

135

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

Saved successfully!

Ooh no, something went wrong!