Open fweber144 opened 2 years ago
Minor update: When re-running the reprex above, I now get the following warnings:
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 0.225752 (tol = 0.002, component 1)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?
Nevertheless, I think this still illustrates the issue.
(Argument nAGQ
was removed as it is only relevant for lme4::glmer()
.)
Further update: As mentioned at https://discourse.mc-stan.org/t/cv-varsel-error-infinite-or-missing-values-in-x/31703/8, the projection of a Gaussian multilevel reference model onto the full model can even lead to an error.
For multilevel Gaussian models, the projection onto the full model could be instable, if not even incorrect:
The instability can be seen from the warnings
shown when debugging as outlined in the reprex above and from comparing
simres$sd_prj
tosimres$sd_ref
.This instability does not seem to occur when projecting onto an actual submodel (e.g., by uncommenting
soltrms <- setdiff(soltrms, grep("^Xcont", soltrms, value = TRUE))
in the reprex above).The reason for the instability could be that in the projection onto the full model (i.e., in the
lme4::lmer()
fit), the residual SD is zero. So far, I did not encounter a similar issue for non-multilevel Gaussian models fitted viaprojpred:::fit_glm_ridge_callback()
or viaprojpred:::fit_glm_callback()
. So this could indeed be restricted to multilevel models.This issue shows that—at least as a first step—the convergence of the algorithms used for fitting the submodels needs to be checked. For this, see the code started in PR #259. As a longer-term objective, I think we need to investigate this issue via simulation to find out if it's really an issue and—if yes—fix it.