The Durbin-Watson test, introduced by J. Durbin and G. S. Watson in 1950 (see reference 1) is used to test for autocorrelation in time series data. More accurately, the test assumes the following underlying model: our response is a linear combination of the features in , i.e. , and the errors come from a stationary Markov process
where and , and is independent of and . (Sometimes this is worded as the errors coming from an AR(1) process.)
The null hypothesis is that . The alternative hypothesis is typically one-sided, and more often than not, the alternative is . This is because positive autocorrelation is much more common than negative autocorrelation in time series data.
Assume that we have data for times . (Here, refers to the th row of the design matrix . The Durbin-Watson statistic is defined as
where denotes the th residual obtained from linear regression (i.e. run linear regression of on , get predictions , then ).
It can be proven fairly easily that we must have . If the null hypothesis is false (and there is positive autocorrelation in the data, i.e. ), then we would expect the denominator of to be small. Hence, we would reject the null hypothesis if is close to 0. Conversely, if there is negative autocorrelation in the data, we would expect to be large (close to 4).
If there is no autocorrelation, . The heuristic explanation for this is that when you expand the numerator, the cross-terms are roughly zero in expectation and so don’t contribute to the numerator.
The cutoffs for the Durbin-Watson test (i.e. thresholds for rejection) depend on the design matrix , as well as the level of significance, the number of observations and the number of features. To avoid the dependence , upper and lower bounds were established for these cutoffs instead.
- Durbin, J., and Watson, G. S. Testing for Serial Correlation in Least Squares Regression: I.
- Durbin-Watson Significance Tables.