Autocorrelation
Autocorrelation is a measure of the correlation between the lagged values of a time series. For example, r1 is the autocorrelation between yt and yt-1; similarly, r2 is the autocorrelation between yt and yt-2. This can be summarized in the following formula:
![](https://static.packt-cdn.com/products/9781788830577/graphics/53a0b659-a6d7-4ded-adc2-2f3f3facebfd.png)
In the preceding formula, T is the length of the time series.
For example, say that we have the correlation coefficients, as shown in the following diagram:
![](https://static.packt-cdn.com/products/9781788830577/graphics/fd0f118f-1030-471b-affd-76a0784750af.png)
To plot it, we get the following:
![](https://static.packt-cdn.com/products/9781788830577/graphics/9947901e-d66a-4461-aa61-5f69e34fb2f4.png)
The following are some observations from this autocorrelation function plot:
- r4 is higher than other lags, which is mostly because of a seasonal pattern
- The blue lines are the indicators of whether correlations are significantly different from zero
- Autocorrelation at lag 0 is always 1