Durbin-Watson Statistic Calculator
Enter ordered regression residuals to calculate the Durbin-Watson statistic from adjacent differences and residual energy. The page exposes every arithmetic component but does not invent an exact p-value, generic pass band, autocorrelation conclusion or trading signal without the original regression design.
Enter ordered residuals
Paste residuals from one fitted model in their original observation order. The calculator does not recover the model design or inspect timestamps.
Enter 20 to 500 finite residuals without percent signs, oldest to newest, from one fitted model.
Durbin-Watson arithmetic
Entered Residual Diagnostics 1.0.0.
On smaller screens, scroll horizontally to inspect the complete audit table.
| Current row | Previous residual | Current residual | Difference | Difference squared |
|---|
How the Durbin-Watson statistic is calculated
Version 1.0.0 keeps the entered order exactly. It subtracts each preceding residual from the current residual, squares all n minus one differences and divides their sum by the squared sum of all n residuals.
The statistic is bounded from zero through four when calculated from a nonzero finite residual vector. Values near two are often described as a reference for little first-order serial correlation, but an exact decision requires design-dependent bounds rather than a universal scorecard.
The audit table retains every previous residual, current residual, difference and squared difference. This makes the displayed numerator independently reproducible instead of hiding it behind a single summary value.
Worked example from the audited fixture
The governed fixture contains 48 ordered residuals independently checked with statsmodels 0.14.6.
- Its adjacent-difference squared sum is 6.02377919 and its residual squared sum is 2.88488534.
- Dividing those quantities produces a Durbin-Watson statistic of 2.08804804. No critical decision or p-value is attached.
Reproduce it: select “Load audited example” above. The governed engine retains full precision and rounds only the visible interface.
How to interpret the result
- Read the output as one summary of adjacent residual movement, not as proof that the fitted model is adequate.
- Ordering matters. Sorting residuals by size or reversing a subset changes the adjacent differences and invalidates the maintained observation sequence.
- The familiar approximation DW ≈ 2(1 − r) is context, not an identity for every finite residual sample. Use the exact displayed ratio for reconciliation.
- Lagged dependent variables, boundary regions and different regression designs affect formal Durbin-Watson interpretation. The page cannot infer those facts from residuals alone.
- Residual autocorrelation can also be inspected across several lags with Ljung-Box or with a model-aware Breusch-Godfrey procedure. Those tests answer different questions.
Assumptions and limits
- Enter 20 to 500 finite residuals from one fitted model in meaningful observation order.
- The calculator cannot verify residual provenance, timestamps, equal spacing, omitted variables, lagged dependent terms, structural breaks or model stability.
- A zero residual squared sum fails closed because the ratio denominator would be zero.
- Version 1.0.0 supplies neither exact Durbin-Watson probabilities nor lower and upper critical bounds because the original design matrix is not entered.
- Rules such as below 1.5 or above 2.5 are not universal inferential boundaries and are deliberately absent.
- No autocorrelation, independence, model-adequacy, predictive-edge, strategy-validation, forecast, grade, signal, position instruction or recommendation verdict is generated.
Which residual diagnostic answers which question?
These four diagnostics do not create one interchangeable model-quality score. They use residual levels or squares, different regressors and different reference systems. Keep the data transformation, maintained null and selected specification visible before interpreting any statistic or probability.
| Diagnostic | Primary question | Output reference | Declared specification | Auxiliary regression |
|---|---|---|---|---|
| Durbin–Watson | Adjacent residual-level movement | Statistic only; design-dependent bounds withheld | Residual order | No |
| Ljung–Box | Joint residual autocorrelation through h | Chi-square upper-tail reference | Maximum lag and fitted orders | No |
| Breusch–Pagan / Koenker | Variance related to entered predictor | Chi-square and F upper-tail references | Predictor and variant | Yes |
| Engle ARCH LM | Squared residuals related to own lags | Chi-square and F upper-tail references | Lag and fitted correction | Yes |
Frequently asked questions
- It divides the squared sum of adjacent residual differences by the squared sum of all entered residuals, preserving the entered order.
- For a nonzero finite residual vector the statistic lies from zero through four, but the page does not convert that range into a universal pass or fail scale.
- Every numerator term compares one residual with its immediate predecessor, so sorting or misaligning rows changes the diagnostic question.
- No. Exact interpretation depends on the sample and original regression design, which cannot be recovered from a residual vector alone.
- Those shortcuts are not universal inferential bounds and can conceal the inconclusive region defined by design-dependent lower and upper critical values.
- No. Durbin-Watson summarizes adjacent residual differences, while Ljung-Box combines estimated autocorrelations through a declared maximum lag.
- No. It does not establish correct variables, stable coefficients, normal residuals, constant variance, forecast accuracy or economic usefulness.
- No. It generates no autocorrelation verdict, model grade, predictive-edge claim, forecast, signal, position instruction or recommendation.
Sources and methodology
- statsmodels — Durbin-Watson — Official implementation documentation for the adjacent-difference ratio and reference range.
- NIST/SEMATECH — Autocorrelation — Official statistical handbook context for residual autocorrelation and diagnostic interpretation.
Version 1.0.0 was locked after its statistics, reference probabilities, auxiliary coefficients and worked examples were independently recomputed with statsmodels 0.14.6 and SciPy 1.13.1. The browser calculator performs local arithmetic and does not upload entered observations. Reference probabilities remain conditional on the disclosed model and data assumptions.
Continue the residual audit
Verify the source model before testing its residuals
Reconcile the exact symbol, fitted equation, observation timestamps, timezone, frequency, missing rows, spread, commission, financing, currency conversion, rollover adjustments and preprocessing before entering residuals. Correct diagnostic arithmetic cannot repair a misspecified, selected, misaligned or cost-inconsistent source model.
Risk and affiliate disclosure: Leveraged forex and CFD trading can result in substantial losses. These are affiliate links, so ForexMT4Indicators.com may receive compensation if you register or trade through them, at no additional cost to you. Availability and terms vary by jurisdiction and broker entity.

