when using cv_varsel from projpred I run into the following error:
Error in if (any(edgevals ← 0 < bdiff & bdiff < boundary.tol)) { : missing value where TRUE/FALSE needed
I’m not sure how to interpret this error message. I assume this is due to convergence issues within the projection. Is there a way to investigate further why this error occurs?
Yes, this sounds like an error produced by the submodel fitter during the projection. Unfortunately, to fix this, a reproducible example is needed (and some session info, at least the projpred version).
For GLMMs, there have been some updates to the submodel fitting in the develop branch of projpred. You can install it via devtools::install_github("stan-dev/projpred", ref = "develop"). Perhaps this solves your problem?
I’ve rerun the model with the latest projpred (2.10) and still got the same error message (albeit the projection needed much more time). In addition, I received a warning:
quick-transfer stage steps exceeded maximum
Some more information:
The random intercept and residual estimates are relatively lowish (~0.6 - 0.7). Perhaps a submodel does not converge due to the LOO-CV process resulting in 0-estimates for the variance parameters?
Some Fixed effects are small as well
When I refit the models without the random intercept cv_varsel runs without problems → GLMM too complex for the data? Although I find this idea problematic since the reference model has no issues.
All this (although the middle point probably doesn’t matter) gives the broad hint that the problem occurs when fitting the multilevel submodels. So it’s related to the lme4 package. The only way I see to fix this is to have a reprex and then to play around with lme4 tuning/control parameters. The develop version of projpred allows to pass arguments to lme4::lmer()/lme4::glmer() (former one for a Gaussian model, latter one for binomial and Poisson models). If you can’t provide a reprex, you would have to play around with lme4 tuning/control parameters yourself. I’m sorry I can’t give a better solution.