Skip to contents

DHARMa 0.5.0

CRAN release: 2026-06-01

Major changes

  • For hierarchical models (GLMMs), we changed the default simulations from the supported model’s default (mostly unconditional) to conditional simulations (for most of the supported models and packages). This represents a major change in the calculated scaled residuals and is implemented to ensure higher power in dispersion and other tests. We expect different results for calculated residuals using this or older DHARMa versions. For compatibility, you can use the argument simulateREs = "user-specified" to change back to the model’s default (older DHARMa versions). See package vignette for more details.

  • In plotResiduals, we increased the threshold for the automatic change from quantile regression lines to the spline: from 2,000 to 10,000 data points. When it happens, a message is displayed to warn users. Also, when quantreg = F, the color of the spline was changed to black because there is no test associated with the line (as there is for quantile regression).

  • In plotResiduals, the argument form has a new functionality. Beyond the syntax data$predictor, it allows now to use the formula structure ~predictor, ~predictor1+predictor2, ~., ~predictor|group and ~predictor|group == "group_level" to plot the residuals against specific/all predictors and grouping variables/levels. This works for most of the supported model functions. It solves problems with NAs in datasets that were excluded by the model. #407 / #425

  • In testCategorical, recalculateResiduals, testQuantiles, testSpatialAutocorrelation and testTemporalAutocorrelation, additional predictors (catPred, group, sel, predictor, time, x,y- respectively) can now be specified as a formula (similar to plotResiduals). This handles rows with NAs that were excluded by the model automatically.

  • brms is now supported by DHARMa for simple models, i.e. models that could also be fit using glmmTMB (no multi-response, multinomial or structural equation models).

Bugfixes

  • Fixing error in runBenchmarks.

  • Fixing inconsistency in testQuantiles() #465. Including rankTransform() help function.

Minor changes

  • Using 95% confidence intervals for confidence bands in plots for testQuantiles(). Before, we were using standard errors (~ 68% CI).

  • Vectorize randomization of residuals to improve speed - PR#493 contributed by StaffanBetner.

  • Adding color legend to testSpatialAutocorrelation().

  • New function plotResidualsAll() to plot residuals against multiple predictors/all predictors of the model via plotResiduals().

  • New function getPredictorNames() extracts names of fixed and random effects (predictors) from a model.

  • testCategorical() now allows additional arguments to boxplot via …, mainly to allow for appropriate x-axis labels when running plotResidualsAll().

  • Improved appearance of user-specified titles via “main” in plotResiduals().

DHARMa 0.4.7

CRAN release: 2024-10-18

New Features

  • Includes support for the package phylolm.
  • New function for testing residual phylogenetic autocorrelation testPylogeneticAutocorrelation().

Major change

  • New optional argument ‘rotation’ in simulateResiduals() for the rotation of the residual space prior to calculating the quantile residuals to account for residual covariance as created by temporal, spatial or phylogenetic autocorrelation.

Minor changes

  • Residual plots: Option to change the red color for significant results to any color of preference through options(DHARMaSignalColor = “red”). This is a good option for color-blind friendly plots.
  • Documentation: improved help files and vignette.

DHARMa 0.4.6

CRAN release: 2022-09-08

New Features

  • new function benchmarkRuntime() for checking runtime of functions
  • new function simulatedLRT() to generate a simulated likelihood ratio test

Bugfixes

  • fixed issue with parallelization in runBenchmarks
  • various minor bugfixed and help improvements

DHARMa 0.4.5

CRAN release: 2022-01-16

Minor changes

  • included option to simulate mgcv models using the functions implemented in mgcViz which should improve mgcv compatibility with DHARMa

  • Added option to include plot title in plot() #320

Bugfixes

  • fixed issues with plotting, see #313 and #274

DHARMa 0.4.4

CRAN release: 2021-09-28

Major changes

  • remodelled tests so that all tested packages can be used conditionally

Minor changes

  • re-introduced glmmTMB to suggests
  • phyr moved to enhances
  • re-modelled package unit tests
  • added RStan, CmdStanR, rjags, BayesianTools to enhances, as they could be used with DHARMa
  • moved parallel calculations in runBenchmark to R native parallel functions

New features

  • Added rotation option to all functions that create residuals (simulateResiduals, recalculateResiduals, createDHARMa)

Documentation

  • Added help comments about autocorrelation structures, in particular in simulateResiduals, testSpatialAutocorrelation, testTemporalAutocorrelation
  • Added example about the use of rotation in testTemporalAutocorrelation
  • Improved help of dispersion test

DHARMa 0.4.3

CRAN release: 2021-07-07

Bugfixes

  • Removed glmmTMB completely, see #289

DHARMa 0.4.2

CRAN release: 2021-07-05

Bugfixes

  • Moved glmmTMB from suggest to import because this package is used in the vignette, see #289

Minor changes

  • Added hurricane dataset
  • Help and vignette updates
  • phyr added in suggests

DHARMa 0.4.1

CRAN release: 2021-04-08

Bugfixes

  • Force method = traditional for refit = T, as it turns out that the PIT method is not a good idea on the residuals, see #272

DHARMa 0.4.0

CRAN release: 2021-03-28

This is actually a bugfix release for 0.3.4, but on reflection I decided that 0.4.0 should have been a minor release, so I pushed the version number up to 0.4.0

Bugfixes

  • bugfix in getResiduals, which had consequences for quantile residual calculations with refit = T

DHARMa 0.3.4

CRAN release: 2021-03-23

0.3.4 is a relatively important release with various minor improvements a smaller new features, most noteworthy the support of glmmAdaptive

New features

  • added parametric dispersion test in testDispersion (0.3.3.2)
  • support for glmmAdaptive (0.3.3.1)
  • new plot for categorical predictors
  • new plots for result of runBenchmarks

Major changes

Minor changes

  • changed test statistics in standard dispersion test to standardized variance, to be more in line with standard dispersion parameters
  • defaults for plot function unified
  • removed option to provide no x,y / time in the correlation tests
  • recalculateResiduals now allows subsetting #246
  • better input checking in correlation tests #190

Bugfixes

DHARMa 0.3.3

Bugfixes

DHARMa 0.3.2

Bugfixes

DHARMa 0.3.1

CRAN release: 2020-05-12

Major changes

  • added PIT quantile calculations based on suggestion in #168. For details see ?getQuantiles

Bugfixes

  • bugfix for passing on parameters to plot.default through plotR.DHARMa and plotResiduals

Minor changes

  • added checks / warnings for models fit with weights

DHARMa 0.3.0

CRAN release: 2020-04-20

New features

  • quantile regressions switched to qgam, which also calculates p-values on the quantile estimates
  • new testQuantiles function, based on the qgam quantile regressions

Changes

  • syntax change for plotResiduals, see ?plotResiduals
  • transformQuantiles is deprecated, functionality included in residuals()
  • nearly all functions can now also be called directly with a fitted model (for computational efficiency, however, it is still recommended to calculate the residuals first)
  • qqPlot now shows disribution, dispersion and outlier test

Bugfixes

  • bugfix #158 for fitting glmmTMB binomial with proportions

DHARMa 0.2.7

CRAN release: 2020-02-06

New features

DHARMa 0.2.6

CRAN release: 2019-11-26

Bugfixes

  • return of plotResiduals set to invisible

DHARMa 0.2.5

CRAN release: 2019-11-18

New features

  • transformQuantiles function added to transform uniform DHARMa residuals to normal or other residuals

Minor changes

  • several smaller corrections to help

DHARMa 0.2.4

CRAN release: 2019-03-06

Bugfixes

  • corrected issues in the vignette
  • small corrections to help

DHARMa 0.2.3

CRAN release: 2019-02-12

Bugfixes

DHARMa 0.2.2

CRAN release: 2019-01-20

Bugfixes

  • fixes bug in Vignette (header lost)

DHARMa 0.2.1

CRAN release: 2019-01-17

New features

Major changes

Minor changes

  • a number of smaller updates, mostly to help files

Bugfixes

  • fixes #82 / Bug in recalculateResiduals

DHARMa 0.2.0

CRAN release: 2018-06-05

New features

Minor changes

Bugfixes

DHARMa 0.1.6

CRAN release: 2018-03-18

New features

Minor changes

  • changed syntax in tests for sptial / temporal autocorrlation * null provides now random. Also, custom distance matrices can be provided to testSpatialAutocorrelation
  • slight changes to plot layout

Bugfixes

DHARMa 0.1.5

CRAN release: 2017-03-10

Minor changes

  • fixes a bug in version 0.1.4 that occurred when running simulateResiduals with refit = T. Apologies for any inconvenience.

DHARMa 0.1.4

CRAN release: 2017-03-07

Major changes

  • new experimental non-parametric dispersion test on simulated residuals. Extended simulations to compare dispersion tests

Minor changes

DHARMa 0.1.3

CRAN release: 2016-12-11

Major changes

Minor changes

  • plotResiduals includes support for factors
  • updates to the help

DHARMa 0.1.2

CRAN release: 2016-11-19

  • This bugfix release fixes an issue with backwards compatibility introduced in the 0.1.1 release, which used the ‘startsWith’ function that is only available in R base since 3.3.0. In 0.1.2, all occurences of ‘startsWith’ were replaced with ‘grepl’, which restores the compatibility with older R versions.

DHARMa 0.1.1

CRAN release: 2016-11-16

  • including now the negative binomial models from MASS and lme4, as well as the possibility to create synthetic data from the negative binomial family
  • includes a createDHARMa function that allows using the plot functions of DHARMa also with externally created simualtions, for example for Bayesian predictive simulations

DHARMA 0.1.0

CRAN release: 2016-08-26

  • initial release, with support for lm, glm, lme4