-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for glmmTMB in DHARMa #16
Comments
glmmTMB has now implemented a simulate function, and I have added this to DHARMa. You can test this by installing the development version of DHARMa (see https://github.com/florianhartig/DHARMa). Note: I had problems with the CRAN version of glmmTMB (crashed with some models). I would therefore recommend installing the development version of glmmTMB before installing DHARMa via
Main limitation is currently that glmmTMB doesn't support the reform argument in either predict or simulate. Predict() is conditional on all random effects, corresponding to lme4 re.form = NULL. Simulate() is unconditional, i.e. all random effects will be re-simulated, corresponding to lme4 re.form = 0. That means that all predictions and simulations are conditional on REs, which can sometimes create a positive correlation between res and predicted , see #43 Other than that, it seems to me that the glmmTMB interacts fine with DHARMa. A simple example is
More examples in the vignette |
Merged into master with ed836dd |
Things that are solved
Things that are still unsolved
|
added instructions about how to calculate unconditional predictions by hand |
Any chance you could test the |
Hi Mollie, yes, I have tested this in https://github.com/florianhartig/DHARMa/tree/2.4.2-glmmTMBfix and it works like a charm, at least as far as the integration in DHARMa and the problem I had with #16 is concerned. As soon as you push this on CRAN, I will do an update to DHARMa! |
Notes to users: if you want to make use of these recent changes
|
Limitations (old)This problem was fixed with 32cbadc and glmmTMB 1.0 ==== The main limitation is currently that glmmTMB doesn't support the reform argument in either predict or simulate. Predict() is conditional on all random effects, corresponding to lme4 re.form = NULL. Simulate() is unconditional, i.e. all random effects will be re-simulated, corresponding to lme4 re.form = 0. That means that all predictions and simulations are conditional on REs, which can sometimes create a positive correlation between res and predicted , see #43
Alternative way to bypass this problem: calculate unconditional predictions by hand - follow this example
|
Since DHARMa 0.2.7 and glmmTMB 1.0, it seems all problems are solved, and I will close this now! |
Hurray! |
What remains open is to ability to condition on REs when simulating, see glmmTMB/glmmTMB#888 |
A user requested support for https://github.com/glmmTMB/glmmTMB
Status of this request (updated)
glmmTMB is supported by DHARMA since https://github.com/florianhartig/DHARMa/releases/tag/v0.1.6.2.
glmmTMB is fully supported (fixing the re.form problem and some other things, see below) since DHARMa 0.2.7 and glmmTMB 1.0
A remaining limitation is the lack of support in glmmTMB to condition simulations on fitted REs, see Implement re.form option in predict() also for simulate() and possibly also for residuals() glmmTMB/glmmTMB#888
A simple example is
More examples in the vignette or in https://github.com/florianhartig/DHARMa/tree/master/Code/DHARMaPackageSupport/glmmTMB
The text was updated successfully, but these errors were encountered: