Auto correlation Function Lecture 14

 Autocorrelation Function 

Lecture 14

Autocorrelation Functions

(ACF)

Autocorrelation quantifies the linear relationship between a time series variable and a lagged value of itself over successive intervals. The autocorrelation diagnoses the time series characteristics and develops prediction models; it is essential to find patterns in the data, such as trends, seasonality, and stationarity or the absence thereof.

In other words,

Autocorrelation is a measure of how closely a time series resembles a lagged version of itself over a series of time intervals.

Let Yt, Yt-1, Yt-2, Yt-3, ..., Yt-k (∈ T, k = 1, 2, 3, ...) be the values of the time series phenomenon. Then the correlations between Yt and its lag Yt-k are denoted by rk and defined as:

Where:

Var(Yt) = Var(Yt-k)

Applications of ACF

i. ACF identifies seasonality in our time series data.

ii. ACF uncovered the hidden pattern in the time series data and helped the data scientist to select the correct method of forecasting.

iii. The analysis of ACF and PACF is necessary for selecting the appropriate ARIMA model for any time series.

 Correlogram

(ACF Plot)

A correlogram is a visual way to show serial correlation in data change over time. In a correlogram or ACF plot, time lag is taken along the x-axis and autocorrelation along the y-axis.

The ACF can be used to determine a time series’ randomness and stationarity. In an ACF plot, each bar represents the size and direction of the connection. Bars that cross the red line are statistically significant.




Significance Bound

A significance bound is a confidence interval that indicates whether a spike is statistically significant or not. If the spikes fall outside of this range, they are considered statistically insignificant. 

The significance bounds of ACF and PACF can be obtained as:

The spikes of ACF and PACF above +Zα/2 / Sqrt and below Zα/2 / Sqrt the bounds are significant.

Practice Question

 Find the autocorrelation function of the following data. Also find 95 % confidence bounds

Time

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

21

17

16

14

13

10

12

15

21

19

18

16

19

21

24

20


Solution:

Yt

Yt-1

Yt-2

Yt-3

21

 

 

 

17

21

 

 

16

17

21

 

14

16

17

21

13

14

16

17

10

13

14

16

12

10

13

14

15

12

10

13

21

15

12

10

19

21

15

12

18

19

21

15

16

18

19

21

19

16

18

19

20

19

16

18

24

21

19

16

21

24

20

19

276

 

 

 



Y¯t = ∑Yt / n

Y¯t = 276 / 16

Y¯t = 17.25

Yt - Y¯t

(Yt-1 - Y¯t) 

(Yt-2 - Y¯t) 

(Yt - Y¯t)(Yt-1 - Y¯t)

(Yt - Y¯t)^2 

3.75

 

 

 

 

-0.25

3.75

 

-0.9375

 

-1.25

-0.25

3.75

0.3125

 

-3.25

-1.25

-0.25

4.0625

 

-4.25

-3.25

-1.25

13.8125

 

-7.25

-4.25

-3.25

30.8125

 

-5.25

-7.25

-4.25

38.0625

 

-2.25

-5.25

-7.25

11.8125

 

3.75

-2.25

-5.25

-8.4375

 

1.75

3.75

-2.25

6.5625

 

0.75

1.75

3.75

1.3125

 

-1.25

0.75

1.75

-0.9375

 

-1.25

0.75

-2.1875

 

2.75

1.75

-1.25

4.8125

 

6.75

2.75

1.75

18.5625

 

3.75

6.75

2.75

25.3125

 

 

 

 

142.9375

219


ACF(1)

ACF(2)
ACF(3)
ACF(4)

95% confidence bounds:

1-α = 0.95

α = 0.05

Zα/2 = Z0.025 = 1.96



Partial Autocorrelation Function

(PACF)

The partial autocorrelation measures the relation between a variable at time t and lag version t – k while the linear effect of in-between lags is filter out

Let Yt, Yt-1, Yt-2, Yt-3, ..., Yt-k be the values of the time series phenomenon. Then the partial auto-correlations between Yt and its lag Yt-k and the linear effect of Yt-1, Yt-2, Yt-3, ..., Yt-k-1 are filtered out.

The 1st order partial auto-correlation will be defined as:

The 1st-order partial auto-correlation will be defined to equal the 1st-order auto-correlation.

The 2nd order (lag) partial auto-correlation is

The 3rd order (lag) partial auto-correlation is

The kth order (lag) partial auto-correlation is

Another way to compute PACF

Let rt1, rt2, ..., rtk be sample auto-correlations of current time “t” and lag 1, 2, …, k. Then the partial auto correlation functions of time “t” and lag 1 while the effect of lag 2 is removed is defined as:

Practice Question

Find the ACF and PACF of the following data; also find the 95 % confidence bounds.

Time

2010

2011

2012

2013

2014

2015

2016

2017

2018

2019

2020

Production

5

7

8

6

9

10

12

14

10

11

9

Solution:

Time

yt

yt-1

Yt-2

2010

5

 

 

2011

7

5

 

2012

8

7

5

2013

6

8

7

2014

9

6

8

2015

10

9

6

2016

12

10

9

2017

14

12

10

2018

10

14

12

2019

11

10

14

2020

9

11

10

 

101

 

 

PACF


Moving Average Models (MA Models) Lecture 17

  Moving Average Models  (MA Models)  Lecture 17 The autoregressive model in which the current value 'yt' of the dependent variable ...