Logo

statsmodels.stats.stattools.durbin_watson

statsmodels.stats.stattools.durbin_watson(resids, axis=0)[source]

Calculates the Durbin-Watson statistic

Parameters:

resids : array-like

Returns:

dw : float, array-like

The Durbin-Watson statistic. :

Notes

The null hypothesis of the test is that there is no serial correlation. The Durbin-Watson test statistics is defined as:

System Message: WARNING/2 (\sum_{t=2}^T((e_t - e_{t-1})^2)/\sum_{t=1}^Te_t^2)

latex exited with error [stdout] This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2011/06/27> Babel <3.9k> and hyphenation patterns for 2 languages loaded. (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty ! LaTeX Error: File `utf8x.def’ not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: def) Enter file name: ! Emergency stop. <read *> l.131 \endinput ^^M No pages of output. Transcript written on math.log.

The test statistic is approximately equal to 2*(1-r) where r is the sample autocorrelation of the residuals. Thus, for r == 0, indicating no serial correlation, the test statistic equals 2. This statistic will always be between 0 and 4. The closer to 0 the statistic, the more evidence for positive serial correlation. The closer to 4, the more evidence for negative serial correlation.

Previous topic

statsmodels.stats.moment_helpers.se_cov

Next topic

statsmodels.stats.stattools.jarque_bera

This Page