Learn R Programming

cSEM (version 0.7.1)

snlminb: Internal: Safer alternative to stats::nlminb()

Description

A safer alternative to stats::nlminb() which doesn't hard error. In the case of an error in stats::nlminb() (e.g.,. a NA/NaN gradient) the error is caught, and a list structured like the return value of stats::nlminb() is returned. Used in polychor() and polyserial(). Implemented by Kjell S. Slupphaug.

Usage

snlminb(
  start,
  objective,
  gradient = NULL,
  hessian = NULL,
  ...,
  scale = 1,
  control = list(),
  lower = -Inf,
  upper = Inf,
  warn.on.failure = TRUE
)

Arguments

References