Английская Википедия:Durbin–Watson statistic
Шаблон:Short description Шаблон:More footnotes In statistics, the Durbin–Watson statistic is a test statistic used to detect the presence of autocorrelation at lag 1 in the residuals (prediction errors) from a regression analysis. It is named after James Durbin and Geoffrey Watson. The small sample distribution of this ratio was derived by John von Neumann (von Neumann, 1941). Durbin and Watson (1950, 1951) applied this statistic to the residuals from least squares regressions, and developed bounds tests for the null hypothesis that the errors are serially uncorrelated against the alternative that they follow a first order autoregressive process. Note that the distribution of this test statistic does not depend on the estimated regression coefficients and the variance of the errors.[1]
A similar assessment can be also carried out with the Breusch–Godfrey test and the Ljung–Box test.
Computing and interpreting the Durbin–Watson statistic
If <math display="inline">e_t</math> is the residual given by <math>e_t = \rho e_{t-1}+ \nu_t ,</math> the Durbin-Watson test statistic is
- <math>d = {\sum_{t=2}^T (e_t - e_{t-1})^2 \over {\sum_{t=1}^T e_t^2}},</math>
where <math display="inline">T</math> is the number of observations. For large <math display="inline">T</math>, <math display="inline">d</math> is approximately equal to <math display="inline">2(1- \hat{\rho})</math>, where <math>\hat \rho</math> is the sample autocorrelation of the residuals.[2] <math display="inline">d = 2</math> therefore indicates no autocorrelation. The value of <math display="inline">d</math> always lies between <math display="inline">0</math> and <math display="inline">4</math>. If the Durbin–Watson statistic is substantially less than 2, there is evidence of positive serial correlation. As a rough rule of thumb, if Durbin–Watson is less than 1.0, there may be cause for alarm. Small values of <math display="inline">d</math> indicate successive error terms are positively correlated. If <math display="inline">d>2</math>, successive error terms are negatively correlated. In regressions, this can imply an underestimation of the level of statistical significance.
To test for positive autocorrelation at significance <math display="inline">\alpha</math>, the test statistic <math display="inline">d</math> is compared to lower and upper critical values (<math display="inline">d_{ L, \alpha}</math> and <math display="inline">d_{ U, \alpha}</math>):
- If <math display="inline">d < d_{ L, \alpha}</math>, there is statistical evidence that the error terms are positively autocorrelated.
- If <math display="inline">d > d_{ U, \alpha}</math>, there is no statistical evidence that the error terms are positively autocorrelated.
- If <math>d_{ L, \alpha} < d < d_{ U, \alpha} </math>, the test is inconclusive.
Positive serial correlation is serial correlation in which a positive error for one observation increases the chances of a positive error for another observation.
To test for negative autocorrelation at significance <math display="inline">\alpha</math>, the test statistic <math display="inline">(4 - d)</math> is compared to lower and upper critical values (<math display="inline">d_{ L, \alpha}</math> and <math display="inline">d_{ U, \alpha}</math>):
- If <math display="inline">(4 - d) < d_{ L, \alpha}</math>, there is statistical evidence that the error terms are negatively autocorrelated.
- If <math display="inline">(4 - d) > d_{ U, \alpha}</math>, there is no statistical evidence that the error terms are negatively autocorrelated.
- If <math>d_{ L, \alpha} < (4 - d) < d_{ U, \alpha} </math>, the test is inconclusive.
Negative serial correlation implies that a positive error for one observation increases the chance of a negative error for another observation and a negative error for one observation increases the chances of a positive error for another.
The critical values, <math display="inline">d_{ L, \alpha}</math> and <math display="inline">d_{ U, \alpha}</math>, vary by level of significance (<math display="inline">\alpha</math>) and the degrees of freedom in the regression equation. Their derivation is complex—statisticians typically obtain them from the appendices of statistical texts.
If the design matrix <math>\mathbf{X}</math> of the regression is known, exact critical values for the distribution of <math>d</math> under the null hypothesis of no serial correlation can be calculated. Under the null hypothesis <math>d</math> is distributed as
- <math>
\frac {\sum_{i=1}^{n-k} \nu_i \xi_i^2} {\sum_{i=1}^{n-k} \xi_i^2},
</math>
where <math display="inline">n</math> is the number of observations and <math display="inline">k</math> is number of regression variables; the <math> \xi_i </math> are independent standard normal random variables; and the <math> \nu_i </math> are the nonzero eigenvalues of <math> ( \mathbf{I} - \mathbf{X} ( \mathbf{X}^T \mathbf{X} ) ^{-1} \mathbf{X}^T ) \mathbf{A}, </math> where <math>\mathbf{A}</math> is the matrix that transforms the residuals into the <math>d</math> statistic, i.e. <math>d = \mathbf{e}^T\mathbf{A}\mathbf{e}.</math> .[3] A number of computational algorithms for finding percentiles of this distribution are available.[4]
Although serial correlation does not affect the consistency of the estimated regression coefficients, it does affect our ability to conduct valid statistical tests. First, the F-statistic to test for overall significance of the regression may be inflated under positive serial correlation because the mean squared error (MSE) will tend to underestimate the population error variance. Second, positive serial correlation typically causes the ordinary least squares (OLS) standard errors for the regression coefficients to underestimate the true standard errors. As a consequence, if positive serial correlation is present in the regression, standard linear regression analysis will typically lead us to compute artificially small standard errors for the regression coefficient. These small standard errors will cause the estimated t-statistic to be inflated, suggesting significance where perhaps there is none. The inflated t-statistic, may in turn, lead us to incorrectly reject null hypotheses, about population values of the parameters of the regression model more often than we would if the standard errors were correctly estimated.
If the Durbin–Watson statistic indicates the presence of serial correlation of the residuals, this can be remedied by using the Cochrane–Orcutt procedure.
The Durbin–Watson statistic, while displayed by many regression analysis programs, is not applicable in certain situations. For instance, when lagged dependent variables are included in the explanatory variables, then it is inappropriate to use this test. Durbin's h-test (see below) or likelihood ratio tests, that are valid in large samples, should be used.
Durbin h-statistic
The Durbin–Watson statistic is biased for autoregressive moving average models, so that autocorrelation is underestimated. But for large samples one can easily compute the unbiased normally distributed h-statistic:
- <math>h = \left( 1 - \frac {1} {2} d \right) \sqrt{\frac {T} {1-T \cdot \widehat {\operatorname{Var}}(\widehat\beta_1\,)}},</math>
using the Durbin–Watson statistic d and the estimated variance
- <math>\widehat{\operatorname{Var}} (\widehat\beta_1)</math>
of the regression coefficient of the lagged dependent variable, provided
- <math>T \cdot \widehat{\operatorname{Var}}(\widehat\beta_1)<1. \,</math>
Implementations in statistics packages
- R: the
dwtest
function in the lmtest package,durbinWatsonTest
(or dwt for short) function in the car package, andpdwtest
andpbnftest
for panel models in the plm package.[5] - MATLAB: the dwtest function in the Statistics Toolbox.
- Mathematica: the Durbin–Watson (d) statistic is included as an option in the LinearModelFit function.
- SAS: Is a standard output when using proc model and is an option (dw) when using proc reg.
- EViews: Automatically calculated when using OLS regression
- gretl: Automatically calculated when using OLS regression
- Stata: the command
estat dwatson
, followingregress
in time series data.[6] Engle's LM test for autoregressive conditional heteroskedasticity (ARCH), a test for time-dependent volatility, the Breusch–Godfrey test, and Durbin's alternative test for serial correlation are also available. All (except -dwatson-) tests separately for higher-order serial correlations. The Breusch–Godfrey test and Durbin's alternative test also allow regressors that are not strictly exogenous. - Excel: although Microsoft Excel 2007 does not have a specific Durbin–Watson function, the d-statistic may be calculated using
=SUMXMY2(x_array,y_array)/SUMSQ(array)
- Minitab: the option to report the statistic in the Session window can be found under the "Options" box under Regression and via the "Results" box under General Regression.
- Python: a durbin_watson function is included in the statsmodels package (
statsmodels.stats.stattools.durbin_watson
), but statistical tables for critical values are not available there. - SPSS: Included as an option in the Regression function.
- Julia: the DurbinWatsonTest function is available in the HypothesisTests package.[7]
See also
Notes
References
- Шаблон:Cite journal
- Шаблон:Cite journal
- Шаблон:Cite book
- Шаблон:Cite book
- Шаблон:Cite journal
- Шаблон:Cite book
External links
- ↑ Шаблон:Cite book
- ↑ Gujarati (2003) p. 469
- ↑ Шаблон:Cite journal
- ↑ Шаблон:Cite journal
- ↑ Шаблон:Cite book
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web