Open bbolker opened 4 months ago
We have an improved implementation in the performance package: https://github.com/easystats/performance/blob/main/R/check_singularity.R
Maybe we should this code instead?
That's a good idea. Where is the insight helper function used?
Do you have an example of a model we can use for tests?
I re-opened after merging the PR, because I still want to add some tests.
insight
has a helper function that claims to check singularity of mixed effect models. It does it by checking to see if any of the diagonal elements of the random effects covariance matrix are less than a tolerance value.This is insufficient for "unstructured" (general positive definite) covariance matrices with dimension > 2 (and maybe >1, I'm not sure).
See https://github.com/easystats/performance/pull/684
lme4
, which parameterizes the covariance matrices by their Cholesky factor, checking the diagonal elements is sufficient