Skip to contents

is_converged() is a compact programmatic flag for workflows that need a yes/no answer before comparing, displaying, or post-processing a drmTMB fit. It is TRUE exactly when convergence_status() is "converged". "boundary" and "degenerate" both return FALSE; use convergence_status() or check_drm() when a three-valued status is needed. converged() is the same predicate under the name DRModels.jl also exports. A fit can therefore report optimizer code 0 while still returning FALSE here.

Usage

is_converged(object, ...)

converged(object, ...)

# Default S3 method
is_converged(object, ...)

# S3 method for class 'drmTMB'
is_converged(object, include_hessian = FALSE, ...)

Arguments

object

A drmTMB fit.

...

Reserved for future convergence options.

include_hessian

Logical; require a positive-definite TMB::sdreport() Hessian in addition to optimizer convergence.

Value

A single logical value.

Details

Set include_hessian = TRUE when the next step needs Wald-style uncertainty. In that mode, is_converged() also requires successful TMB::sdreport() output with pdHess = TRUE on top of the default convergence_status() requirements. A fit can therefore be "converged" while still returning FALSE with include_hessian = TRUE; this marks an inference-readiness problem, not automatic proof that point estimates are unusable.

Use check_drm() when you need the full diagnostic table and messages.

Examples

set.seed(20260531)
dat <- data.frame(y = rnorm(30), x = rnorm(30))
fit <- drmTMB(bf(y ~ x, sigma ~ 1), data = dat)
is_converged(fit)
#> [1] TRUE
converged(fit)
#> [1] TRUE
is_converged(fit, include_hessian = TRUE)
#> [1] TRUE