-
Notifications
You must be signed in to change notification settings - Fork 22
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
simulateResidual error - incorrect number of dimensions #434
Comments
I have figured out the issue here, posting info for posterity. Seems that the resids column was stored as a matrix within the data frame used for the model. It was not converted through the glmmTMB function which I suppose was causing problems when handed to DHARMa. So seems that the column classes are important even at the modelling stage. |
Hi @NLJames, as Melina said, we'll be looking at this - for this, and just if it's no inconvenience, it could be useful if you could provide a reproducible example of your problem and post it here, just so that we can check if a possible solution to the issue fixes the problem? Cheers |
If this is something that triggers any problems in glmmTMB (as opposed to being DHARMa-specific) please post an issue for glmmTMB as well. |
A reproducible example of a warning (not an error): mtcars$mpg <- scale(mtcars$mpg)
m <- glmmTMB::glmmTMB(mpg ~ cyl, data = mtcars)
DHARMa::simulateResiduals(m)
Object of Class DHARMa with simulated residuals based on 250 simulations with refit = FALSE . See ?DHARMa::simulateResiduals for help.
Scaled residual values: 0.548 0.564 0.116 0.612 0.912 0.208 0.44 0.272 0.112 0.292 0.16 0.68 0.772 0.548 0.076 0.076 0.504 0.972 0.9 1 ...
(Adding a random effect and |
Hi @bbolker, thanks for sharing an example with the warnings. It was an issue with the function getObservedResponse.default() that was expecting a matrix for the observed responses only for n/k binomial models. We no longer have a warning about "binomial" problems when the response variable is a matrix (as when using scale()). However, I'm not sure anymore if this issue problem is related to it. @NLJames, if possible, could you please provide a reproducible example of your case? It would be also great if you could try to run the code with the latest DHARMa development version to check if the solution to issue #280 also worked for your problem. :) Best, |
Hi @florianhartig,
Firstly, DHARMa is amazing, thank you for all the hard work.
I am having an issue I have never encountered after hundreds of uses of this function. I ran a model in glmmTMB which I have checked has converged with a sensible output. But running
simulateResiduals()
on this object does not seem to be able to interpret the output. Strangley, I have never had this issues before with glmmTMB model objects. Can you shed any light on why this is happening? I can share the data if need be.Error message
The text was updated successfully, but these errors were encountered: