converged {buildmer}R Documentation

Test a model for convergence

Description

Test a model for convergence

Usage

converged(model, singular.ok = FALSE, grad.tol = 0.1, hess.tol = 0.01)

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 cl(m)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)

[Package buildmer version 2.11 Index]