use crateOlsFit;
/// Durbin-Watson statistic for first-order residual autocorrelation.
///
/// `DW = Σₜ₌₂ⁿ (eₜ − eₜ₋₁)² / Σₜ eₜ²`, ranging in `[0, 4]`: values near **2**
/// indicate no autocorrelation, near **0** strong positive autocorrelation, near
/// **4** strong negative.
///
/// # Ordering assumption
///
/// This statistic only means something if the observations are in a meaningful
/// order — time, or a spatial sequence. On data with no natural ordering it is
/// **not a valid diagnostic**: reordering the rows would change the value while
/// the model is identical. It is most relevant in the time-series setting (see
/// the guide's Time Series chapter); for cross-sectional data reach for a
/// heteroskedasticity or normality test instead.