Unconstrained and box-constrained optimization using PORT routines.
For historical compatibility.
nlminb(start, objective, gradient = NULL, hessian = NULL, …,
scale = 1, control = list(), lower = -Inf, upper = Inf)numeric vector, initial values for the parameters to be optimized.
Function to be minimized. Must return a scalar value. The first
argument to objective is the vector of parameters to be
optimized, whose initial values are supplied through start.
Further arguments (fixed during the course of the optimization) to
objective may be specified as well (see …).
Optional function that takes the same arguments as objective and
evaluates the gradient of objective at its first argument. Must
return a vector as long as start.
Optional function that takes the same arguments as objective and
evaluates the hessian of objective at its first argument. Must
return a square matrix of order length(start). Only the
lower triangle is used.
Further arguments to be supplied to objective.
See PORT documentation (or leave alone).
A list of control parameters. See below for details.
vectors of lower and upper bounds, replicated to be as long as
start. If unspecified, all parameters are assumed to be
unconstrained.
A list with components:
The best set of parameters found.
The value of objective corresponding to par.
An integer code. 0 indicates successful
convergence.
A character string giving any additional information returned by the
optimizer, or NULL. For details, see PORT documentation.
Number of iterations performed.
Number of objective function and gradient function evaluations
Possible names in the control list and their default values
are:
eval.maxMaximum number of evaluations of the objective function allowed. Defaults to 200.
iter.maxMaximum number of iterations allowed. Defaults to 150.
traceThe value of the objective function and the parameters is printed every trace'th iteration. Defaults to 0 which indicates no trace information is to be printed.
abs.tolAbsolute tolerance. Defaults
to 0 so the absolute convergence test is not used. If the objective
function is known to be non-negative, the previous default of
1e-20 would be more appropriate.
rel.tolRelative tolerance. Defaults to
1e-10.
x.tolX tolerance. Defaults to 1.5e-8.
xf.tolfalse convergence tolerance. Defaults to
2.2e-14.
step.min, step.maxMinimum and maximum step size. Both
default to 1..
singular convergence tolerance; defaults to
rel.tol.
...
an estimated bound on the relative error in the objective function value.
Any names of start are passed on to objective and where
applicable, gradient and hessian. The parameter vector
will be coerced to double.
If any of the functions returns NA or NaN this is an
error for the gradient and Hessian, and such values for function
evaluation are replaced by +Inf with a warning.
David M. Gay (1990), Usage summary for selected optimization routines. Computing Science Technical Report 153, AT&T Bell Laboratories, Murray Hill.
optim (which is preferred) and nlm.
optimize for one-dimensional minimization and
constrOptim for constrained optimization.