Residual Diagnostics

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.

Adjacent differences auditedNo shortcut thresholdsNo serial-correlation verdict

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.

Entered

Enter 20 to 500 finite residuals without percent signs, oldest to newest, from one fitted model.

Durbin-Watson boundary: Exact lower and upper decision bounds depend on sample size and the original regressor design. Version 1.0.0 reports the statistic and its zero-to-four reference range without applying generic 1.5 or 2.5 cutoffs.

Durbin-Watson arithmetic

Entered Residual Diagnostics 1.0.0.

Derived
Enter residuals to beginThe result will expose each adjacent difference, both sums of squares and the statistic without a model-adequacy label.

How the Durbin-Watson statistic is calculated

DW = Σt=2..n(et − et−1)² ÷ Σt=1..net²

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.

  1. Its adjacent-difference squared sum is 6.02377919 and its residual squared sum is 2.88488534.
  2. 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.

Comparison of residual questions, references, specifications and auxiliary regressions
DiagnosticPrimary questionOutput referenceDeclared specificationAuxiliary regression
Durbin–WatsonAdjacent residual-level movementStatistic only; design-dependent bounds withheldResidual orderNo
Ljung–BoxJoint residual autocorrelation through hChi-square upper-tail referenceMaximum lag and fitted ordersNo
Breusch–Pagan / KoenkerVariance related to entered predictorChi-square and F upper-tail referencesPredictor and variantYes
Engle ARCH LMSquared residuals related to own lagsChi-square and F upper-tail referencesLag and fitted correctionYes

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

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.

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.

XM

Review applicable statements, symbol specifications and execution terms.

Check XM terms

FBS

Confirm account-history and trading-cost conventions for your region.

Check FBS terms

FXOpen

Verify statement, charge and execution records before deriving inputs.

Check FXOpen terms

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.

Disclaimer: The results from this tool are estimates for educational and informational purposes only and may differ from your broker's figures. This is not financial or investment advice. Trading forex and CFDs carries a high level of risk and can result in the loss of all your capital. Always verify calculations with your broker and trade within your risk tolerance.