Error when running cv_varsel


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?

Any help is appreciated. Thank you in advance.

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).

1 Like

Thank you for your quick response.

A simple example is difficult to produce since the model used is relatively big (high computation time) and I do not know the origin of this problem.

It is a GLMM with a random intercept term. The projpred version is 2.02.

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.