Skip to contents

Returns TRUE if the model converged during fitting and FALSE otherwise. The reason for convergence or non-convergence is attached as the names attribute of the return value, so it prints alongside the logical result.

Usage

emax_converged(mod)

Arguments

mod

An emaxnls object

Value

A named logical scalar. The value is TRUE when the model converged and FALSE otherwise. The names attribute holds a short description of the outcome:

  • "converged": the optimiser reached a solution successfully.

  • "maximum time exceeded": the max_time limit set in emax_nls_options() / emax_logistic_options() was hit before the optimiser finished.

  • "maximum iterations exceeded": the optimiser ran out of iterations. This applies to the Gauss-Newton algorithm (when nls() reports "number of iterations exceeded maximum") and to the Levenberg-Marquardt algorithm (when nlsLM() reports that the iteration count has reached maxiter). The iteration budget can be increased via the optim_control argument of emax_nls_options().

  • Raw optimiser message: all other failures return the error message from the underlying optimiser directly. Common examples include a singular gradient matrix at the initial parameter estimates, the Gauss-Newton step factor collapsing below minFactor, and Port-algorithm convergence codes such as false convergence (code 8) or singular convergence (code 7). These messages are algorithm-specific and are passed through unchanged because no single label covers them accurately.