Statistical Diagnostics calculator

Durbin-Watson autocorrelation test calculator

Evaluate first-order autocorrelation in regression residuals using the Durbin-Watson d statistic.

Run this test live in StatLab npm i @statlab/core

When to use it

Use when fitting regression models to time-ordered telemetry data.

Required Inputs

  • Regression residuals vector e_t

Mathematical Formula

d = Σ (e_t - e_{t-1})² / Σ e_t²

Reporting Cautions

  • d ranges from 0 to 4; d ≈ 2 indicates no autocorrelation; d < 1.5 indicates positive autocorrelation.
  • Only tests for first-order (lag-1) autocorrelation.

Code Snippets (Python, R, TypeScript)

Python (SciPy / Statsmodels)
from statsmodels.stats.stattools import durbin_watson
d = durbin_watson(model.resid)
print(f"d={d:.4f}")
R Language
library(lmtest)
dwtest(lm_model)
TypeScript (@statlab/core)
import { durbinWatson } from '@statlab/core';
const d = durbinWatson(residuals);

Developer Use Cases & Production Integrations

  • Checking for serial autocorrelation in time-series server latency regressions.
  • Ensuring error independence in sequential benchmark runs.

VoxelPulse Telemetry Control Plane

Continuous A/B testing, statistical telemetry analysis, and automated feedback loops for live backend services.

Explore VoxelPulse →

VoxelAssurance Release Readiness

Fixed-price AI release-readiness sprints, automated regression testing, and reliability statistical benchmarks.

Explore VoxelAssurance →

Related Statistical Test Calculators

Explore static calculators across the StatLab inference engine suite.