nlminb2NLP {Rnlminb2} | R Documentation |
Solve constrained nonlinear minimization problem with nonlinear constraints. An alternative function wrapper.
nlminb2NLP( par, fun, par.lower = NULL, par.upper = NULL, eqA = NULL, eqA.bound = NULL, ineqA = NULL, ineqA.lower = NULL, ineqA.upper = NULL, eqFun = list(), eqFun.bound = NULL, ineqFun = list(), ineqFun.lower = NULL, ineqFun.upper = NULL, control = list())
par |
parameter vector(vector object). |
fun |
the objective function to be minimized. Currently, fn
must take only one argument, and the parameter vector(par )
will be passed to fn during the optimization. The first
element of return value must be the evaluated value. |
par.lower, par.upper |
upper and lower bounds for parameter vector, respectively. Their
length must equal to length(par) . |
eqA, ineqA |
the matrix objects that represents linear constraints. Its
columns must be equal to length(par) , and its rows
must be equal to the number of linear constraints. |
eqA.bound |
equality bounds for linear constraints, respectively. Their length must equal to the number of linear constraints. |
ineqA.lower, ineqA.upper |
upper and lower bounds for linear constraints, respectively. Their length must equal to the number of linear constraints. |
eqFun |
list object whose elements are functions that represents nonlinear equality constraints. |
eqFun.bound |
equality bounds for nonlinear constraints, respectively. |
ineqFun |
list object whose elements are functions that represents nonlinear lower and upper constraints. |
ineqFun.lower, ineqFun.upper |
lower and upper bounds for nonlinear constraints, respectively. |
control |
list of control parameters that define the behaviour of the
solver. See nlminb2Control for details. |
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. |
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.
Paul A. Jensen & Jonathan F. Bard, Operations Research Models and Methods, 2001 Appendix A, Algorithms for Constrained Optimization, http://www.me.utexas.edu/~jensen/ORMM/supplements/index.html.
PORT Library, http://netlib.bell-labs.com/netlib/port/.
nlminb2
, nlminb2Control
,
and packages Rdonlp2
and Rsolnp2
.
## Example: # Feasible Start Solution: start = c(10, 10) # Objective Function: x^2 + y^2 fun <- function(x) sum(x^2) # Bounds: -100 <= x,y <= 100 par.lower = c(-100, -100) par.upper = c(100, 100) # Equality Constraints: x*y = 2 eqFun <- list( function(x) x[1]*x[2]) eqFun.bound = 2 # Solution: x = c(sqrt(2), sqrt(2)), f(x) = 4 nlminb2NLP(par = start, fun = fun, par.lower = par.lower, par.upper = par.upper, eqFun = eqFun, eqFun.bound = eqFun.bound)[-1]