Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

converged

Test a model for convergence


Description

Test a model for convergence

Usage

converged(model, singular.ok = FALSE, grad.tol = 0.04, hess.tol = 0.002)

Arguments

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.

Value

Logical indicating whether the model converged.

Examples

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)

buildmer

Stepwise Elimination and Term Reordering for Mixed-Effects Regression

v1.9
FreeBSD
Authors
Cesko C. Voeten [aut, cre] (<https://orcid.org/0000-0003-4687-9973>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.