440 Statistical Methods
three, or more years earlier. To discover the relationship between a time series
and other lagged values of the series, statisticians calculate the autocorrela-
tion function.
The Autocorrelation Function
If there is some pattern in how the values of your time series change from
observation to observation, you could use it to your advantage. Perhaps a
below-average value in one year makes it more likely that the series will be
high in the next year, or maybe the opposite is true—a year in which the series
is low makes it more likely that the series will continue to stay low for a while.
The autocorrelation function (ACF) is useful in fi nding such patterns. It
is similar to a correlation of a data series with its lagged values. The ACF
value for lag 1 (denoted by r 1 ) calculates the relationship between the data
series and its lagged values. The formula for r 1 is
r 15
(^1) y 22 y (^21) y 12 y (^211) y 32 y (^21) y 22 y 21 c 11 yn 2 y (^21) yn 212 y 2
(^1) y 12 y (^2211) y 22 y 221 c 11 yn 2 y 22
Here, y 1 represents the fi rst observation, y 2 the second observation, and
so forth. Finally, yn represents the last observation in the data set. Similarly,
the formula for r 2 , the ACF value for lag 2, is
r 25
(^1) y 32 y (^21) y 12 y (^211) y 42 y (^21) y 22 y 21 c 11 yn 2 y (^21) yn 222 y 2
(^1) y 12 y (^2211) y 22 y 221 c 11 yn 2 y 22
The general formula for calculating the autocorrelation for lag k is
rk 5
(^1) yk 112 y (^21) y 12 y (^211) yk 122 y (^21) y 22 y 21 c 11 yn 2 y (^21) yn 2 k 2 y 2
1 y 12 y 2211 y 22 y 221 c 11 yn 2 y 22
Before considering the autocorrelation of the temperature data, let’s apply
these formulas to a smaller data set, as shown in Table 11-2.
Table 11-2 Sample Autocorrelation Data
Observation Values Lag 1 Values
6
4
8
5
0
Lag 2 Values
16
24
38 6
45 4
50 8
67 5