← Back to all sparks
D

DHARMa

ANALYTICS
Velocity0.0

Residual Diagnostics for Hierarchical (Multi-Level / Mixed) Regression Models

DHARMa changed how GLMM residuals are simulated, so the same code now returns different numbers.

residual-diagnosticsglmmbreaking-changebayesianr-package
Current state
DHARMa generates scaled quantile residuals for fitted GLMMs and runs the dispersion, uniformity, and autocorrelation tests built on them. Version 0.5.0 changed the default simulation for hierarchical models from the model's own default, mostly unconditional, to conditional simulation, and states plainly that residuals will differ from those computed by older versions. The same release added brms to the supported model set and reworked how predictors are passed to plotting and testing functions.
Where it's heading
The package has spent several releases widening which model backends it can diagnose, from glmmTMB through mgcv, phylolm and now brms, while methodological work has gone into handling correlated residuals via the rotation argument. Version 0.5.0 shifts from adding coverage to changing defaults for statistical power. The formula interface arriving across plotResiduals, testCategorical, testQuantiles and the autocorrelation tests suggests the API is being unified rather than extended function by function.
Prediction
The next releases will likely broaden brms support past the simple-model restriction and continue converting remaining functions to the formula interface.

Recent moves

  1. 2mo ago

    Conditional simulation becomes the GLMM default, changing residuals

    ⚡ SPARK

    The release where DHARMa stops widening backend coverage and starts changing what it computes. Conditional simulation becomes the default for hierarchical models, and the formula interface introduced here is the same unification visible across the testing functions.

    View source ↗
  2. 1y ago

    DHARMa 0.4.7

    Adds phylolm support and a phylogenetic autocorrelation test, plus the rotation argument that accounts for residual covariance from temporal, spatial or phylogenetic structure. This is the backend-widening phase that 0.5.0 later pivots away from.

    View source ↗
  3. 3y ago

    DHARMa 0.4.6

    Adds a simulated likelihood ratio test and a runtime benchmarking helper. Incremental additions to the diagnostic toolkit rather than changes to the residuals themselves.

    View source ↗
  4. 4y ago

    DHARMa 0.4.5

    Routes mgcv model simulation through mgcViz to improve compatibility, and adds a plot title option. Small steps in the same backend-coverage direction.

    View source ↗
  5. 4y ago

    DHARMa 0.4.4

    Introduces the rotation option across all residual-creating functions and makes every supported package conditional rather than required. The rotation work here is the methodological groundwork that 0.4.7 built on.

    View source ↗
  6. 5y ago

    DHARMa 0.4.3

    A single dependency removal resolving a packaging issue. No effect on residuals or tests.

    View source ↗