# Detection of autocorrelation

From the previous discussion we understand that autocorrelation is bad which emphasize the importance of learning how to detect it. Below we will describe the most common procedures found in the text book literature. We will not discuss any graphical methods since they sometimes are difficult to interpret. In the introduction of the chapter we gave some examples on how graphical methods could be used. In more advanced time series analysis, graphical methods based on autocorrelation functions and partial autocorrelation functions are frequently used. However, we will not discuss these methods here.

## The Durbin Watson test

The Durbin Watson test (DW) is maybe the most common test for autocorrelation and is based on the assumption that the structure is of first order. Since first order autocorrelation is most likely to appear in time series data, the test is very relevant, and all statistical software has the option of calculating it automatically for us.

The Durbin-Watson test statistic for first order autocorrelation is given by:

with * e *being the estimated residual from a sample regression model. To see that this test statistic is related to the first order autocorrelation case we may rewrite (10.12) in the following way:

where p on the right hand side is the autocorrelation coefficient from a first order autoregression scheme. However, it is only an approximation since the expressions in the numerator sum from 2 to * t *instead of 1 to

*as is the case in the denominator. The larger the value of*

**t***the better is the approximation.*

**t**From (10.13) it is possible to see that the * dw *test statistic only takes values between 0 and 4 since the autocorrelation coefficient only takes values between -1 and 1. Hence when the autocorrelation coefficient equals 0, the

*test statistics equals 2. If*

**dw***> 2 we have an indication of a negative autocorrelation, and if*

**dw***< 2 we would have an indication of a positive autocorrelation. However, since the relationship is an approximation, the*

**dw***test value can sometimes deviate from 2 even though the autocorrelation coefficient is zero. So the standard question is how much it should be allowed to deviate? Could we use some critical values to help us interpret the estimated value of*

**dw**

**dw.**Unfortunately there exist no simple distribution function for this test function since it depends on the number of observations used as well as the values of the explanatory variables used in the regression. For that reason it is not possible to establish a precise critical value for the * dw *test statistic. However, Durbin and Watson made some simulations so that we, based on the number of observations used, and the number of parameters included in the model, can find a lower value (L) and an upper value (U) to compare the DW test value with.

Table 10.1 show five different regions where the DW-test value potentially could end up. If we receive a test value that is located in the interval between the lower value (L) and the upper value (U) our test is inconclusive and we have no use of the DW-test. However, if the DW-value is between 0 and the lower value (L) we can draw the conclusion of having a positive autocorrelation. In the statistical table, with upper and lower values for the DW-test, we will only find the values that refer to the section below 2. In case of a negative autocorrelation we have to form the upper and lower value our self, using L and U as is done in Table 10.1.

**Example 10.1**

Assume that we have a time series with 150 observations, and two explanatory variables that will be used to explain the dependent variable. Running the regression we received a DW-test value equal to 1.63. In the table with critical values for the Durbin Watson test we found that L=1.71 and U=1.76. Since the test value is outside the inconclusive interval and below the lower value we have to draw the conclusion that our model suffer from positive autocorrelation.

**Example 10.2**

We have the same set up as in the previous example but with a DW-test value equal to 2.35. In the table we found the value for L=1.71 and the value for U=1.76. Using these values we can calculate the inconclusive interval related to DW-values larger than 2. Using the information in Table 10.1 we received: (4-U) = (4-1.76) = 2.24 and (4-L) = (4-1.71) = 2.29. Since the test value of 2.35 is outside the interval and larger than the upper value of 2.29 we must conclude that our model suffer from negative autocorrelation.