# nlminb2: Constrained nonlinear minimization In fPortfolio: Rmetrics - Portfolio Selection and Optimization

 nlminb2 R Documentation

## Constrained nonlinear minimization

### Description

Solve constrained nonlinear minimization problem with nonlinear constraints using a penalty and barrier approach.

### Usage

``````nlminb2(start, objective, eqFun = NULL, leqFun = NULL,
lower = -Inf, upper = Inf, gradient = NULL, hessian = NULL,
control = list(), env = .GlobalEnv)
``````

### Arguments

 `start` a numeric vector, initial values for the parameters to be optimized. `objective` function to be minimized. Must return a scalar value (possibly NA/Inf). 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 `env`. `eqFun` a list of functions describing equal constraints. `leqFun` a list of functions describing less equal constraints. `lower, upper` two vectors of lower and upper bounds, replicated to be as long as `start`. If unspecified, all parameters are assumed to be unconstrained. `gradient` an 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`. `hessian` an 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. `control` a list of control parameters. See below for details. `env` the environment in which objective, constraint, control functions are evaluated.

### Value

A list with following elements:

 `par` a numeric vector, the best set of parameters found. `objective` a numeric value, the value of `objective` corresponding to `par`. `convergence` an integer code, 0 indicates successful convergence. `message` a character string giving any additional information returned by the optimizer, or NULL. For details, see PORT documentation. `iterations` am integer value, the number of iterations performed. `evaluations` an integer value, the number of objective function and gradient function evaluations.

### Author(s)

For the R port of `nlminb` Douglas Bates and Deepayan Sarkar, for the R/Rmetrics port of `nlminb2` Diethelm Wuertz, for the PORT library netlib.bell-labs.com.

### References

Paul A. Jensen & Jonathan F. Bard, Operations Research Models and Methods, 2001 Appendix A, Algorithms for Constrained Optimization, https://www.me.utexas.edu/~jensen/ORMM/supplements/index.html.

PORT Library, https://netlib.org/port/.

fPortfolio documentation built on April 25, 2023, 9:11 a.m.