converged | R Documentation |
Test a model for convergence
converged(model, singular.ok = FALSE, grad.tol = 0.1, hess.tol = 0.01)
model |
The model object to test. |
singular.ok |
A logical indicating whether singular fits are accepted as ‘converged’ or not. Relevant only for lme4 models. |
grad.tol |
The tolerance to use for checking the gradient. This is currently only used by mgcv, glmmTMB, and clm(m) models. |
hess.tol |
The tolerance to use for checking the Hessian for negative eigenvalues. This is currently only used by mgcv, glmmTMB, and clm(m) models. |
Logical indicating whether the model converged.
library(buildmer) library(lme4) good1 <- lm(Reaction ~ Days,sleepstudy) good2 <- lmer(Reaction ~ Days + (Days|Subject),sleepstudy) bad <- lmer(Reaction ~ Days + (Days|Subject),sleepstudy,control=lmerControl( optimizer='bobyqa',optCtrl=list(maxfun=1))) sapply(list(good1,good2,bad),converged)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.