# DATA SCIENCE USING PYTHON

## ONLINE TRAINING COURSE

# Autoregressive Integrated Moving Average (ARIMA) Model

The values of a series of data at a particular point in time is highly correlated with the values that precede and succeed them. In simple term, observations are not independent. This can be checked by using Durbin-Watson statistics as follow:

d = \(\frac {∑ (et – et-1)}{∑e2}\)

where e = Error term at time t

- Durbin-Watson (d) test can be used to test for the autocorrelation in the time-series data.
- Smaller d (near 0) means positively correlated data.
- Larger d (near 4) means negatively correlated data.
- d approximately 2 indicates a no autocorrelation present in the time-series.

We can model the autocorrelation if present in the time-series by using Autoregressive Integrated Moving Average (ARIMA) models.

First - Order Autocorrelation Model (association between two consecutive values in the series)

Y_{i} = A_{0} + A_{1}Y_{i-1} + Ɛ_{i}

Second - Order Autocorrelation Model (association between values that are two periods apart)

Y_{i} = A_{0} + A_{1}Y_{i-1} + A_{2}Y_{i-2}+ Ɛ_{i}

p^{th} Order Autocorrelation Model (association between values that are pth periods apart)

Y_{i} = A_{0} + A_{1}Y_{i-1} + A_{2}Y_{i-2}+ ...A_{p}Y_{i-p} +Ɛ_{i}

*Y _{i}* = Observed value of time-series at time i

*Y*= Observed value of time-series at time i – 1

_{i-1}*A*= Fixed least-square parameter

_{0}*A*= Autoregressive parameters to be estimated using least-square regression.

_{1}, A_{2}, A_{p}*Ɛ*= Random error at time i

_{i}
Forecast = Ŷ_{n + j} = A_{0} + A_{1} Ŷ_{n + j -1} + A_{2} Ŷ_{n + j -2} + … A_{p} Ŷ_{n + j -p}

Notes:

It is important to select the order of autocorrelation in the Auto-Regressive models. You can use the t-test to test for the significance of respective order of autocorrelation. In Eastman Kodak revenue, third order auto-regressive model is not significant and hence, second order model is fitted to the time series data and same is used to forecast the value for Year = 2000 and 2001.

You must be equally concern with selecting the high order model as it requires estimation of high order parameters. This may cause problem especially when the number of observations are less.