fit_opt: fit_opt

View source: R/fit_opt.R

fit_optR Documentation

fit_opt

Description

nonlinear optimization: wrapper for optimx and nloptr

Usage

fit_opt(
  objective,
  start,
  lower = NULL,
  upper = NULL,
  hessian = FALSE,
  package = "optimx",
  method = NULL,
  restart = FALSE,
  consecutive = 0L,
  max_runs = Inf,
  sigma = 0.1,
  tol = 1e-05,
  verbose = FALSE,
  opt_args = list(),
  obj_args = list(),
  ...
)

Arguments

objective

function; the objective function to minimize

start

numeric vector; starting parameters

lower

numeric vector; lower bounds for parameters

upper

numeric vector; upper bounds for parameters

hessian

logical; if TRUE, calculate hessian at solution

package

string; package to use, see Details. Default = "optimx"

method

string; method to use from package

restart

logical; if TRUE, restart optimization until no more improvement. Default = FALSE

max_runs

integer; maximum number of optimx runs. Default = Inf

sigma

numeric; standard deviation for random perturbation of starting values

verbose

logical; if TRUE, print result summary after each iteration.Default=FALSE

opt_args

list; list of arguments to be passed to optimx

obj_args

list; list of arguments to be passed to objective function

...

further arguments objective

conescutive

integer; stop after this number of consecutive runs without improvement. Default = 0

tolerance

numeric; new fit must change objective by 'tolerance' to be considered an improvement

Details

Package options = "optimx", "optim", "nloptr", "pracma"


gkane26/modelfitr documentation built on March 21, 2022, 10:52 a.m.