mpmm_control: Control Values for 'mpmm'.

View source: R/mpmm_control.R

mpmm_controlR Documentation

Control Values for mpmm.

Description

mpmm_control selects the numerical minimizer, method, associated control parameters, parameter bounds, and likelihood estimation (REML or ML) used by mpmm.

Usage

mpmm_control(
  optim = c("nlminb", "optim"),
  method = c("BFGS", "L-BFGS-B"),
  lower = NULL,
  upper = NULL,
  REML = FALSE,
  profile = FALSE,
  verbose = 2,
  ...
)

Arguments

optim

the numerical optimizer used in the fit

method

optimization method to be used - one of "BFGS" or "L-BFGS-B" for bounded optimization (default lower and upper bounds are used if not specified

lower

a list of named parameter lower bounds, if NULL then built in defaults are used when method = "L-BFGS-B", otherwise ignored

upper

a list of named parameter upper bounds, if NULL then built in defaults are used when method = "L-BFGS-B", otherwise ignored

REML

logical; whether to use REML (TRUE) or maximum likelihood

profile

logical; option to improve speed and convergence by using REML parameter estimates as initial values for ML optimization

verbose

integer; report progress during minimization: 0 = silent; 1 = optimizer trace; 2 = parameter trace (default))

...

control parameters for the chosen optimizer

Details

The optimizer used to minimize the objective function is selected by the optim argument. Additional control parameters specific to the chosen optimizer are specified via the dots argument. See nlminb and optim for available options. Adapted from S. Wotherspoon https://github.com/SWotherspoon/RWalc/blob/master/R/RWalc.R

Value

Returns a list with components

optim

the name of the numerical optimizer as a string, "nlminb" or "optim"

method

optimization method to be used

lower

named list of lower parameter bounds

upper

named list of upper parameter bounds

REML

whether REML is to be used in place of ML

profile

whether to enhance convergence robustness

verbose

level of tracing information to be reported

control

list of control parameters for the optimizer

See Also

nlminb, optim.

Examples

fit <- mpmm(~ ice + (ice | id),
data = ellie.ice.short,
control = mpmm_control(
    optim = "nlminb",
    REML = FALSE,
    eval.max = 2000)
    )

ianjonsen/mpmm documentation built on Dec. 7, 2022, 4:27 a.m.