optimNLOPTR: optimNLOPTR. Minimization by NLOPT

View source: R/optimNLOPTR.R

optimNLOPTRR Documentation

optimNLOPTR. Minimization by NLOPT

Description

#' This is a wrapper that employs the nloptr function from the package of the same name. The nloptr function itself is an interface to the nlopt library, which contains a wide selection of different optimization algorithms.

Usage

optimNLOPTR(x = NULL, fun, lower, upper, control = list(), ...)

Arguments

x

optional matrix of points to be included in the evaluation (only first row will be used)

fun

objective function, which receives a matrix x and returns observations y

lower

boundary of the search space

upper

boundary of the search space

control

named list, with the options for nloptr. These will be passed to nloptr as arguments. In addition, the following parameter can be used to set the function evaluation budget:

funEvals

Budget, number of function evaluations allowed. Default: 100.

...

passed to fun

Note that the arguments x, fun, lower and upper will be mapped to the corresponding arguments of nloptr: x0, eval_f, lb and ub.

Value

list, with elements

x

archive of evaluated solutions

y

archive of observations

xbest

best solution

ybest

best observation

count

number of evaluations of fun

message

success message

Examples


##simple example:
res <- optimNLOPTR(,fun = funSphere,lower = c(-10,-20),upper=c(20,8))
res
##with an inequality constraint:
contr <- list()  #control list
##specify constraint
contr$eval_g_ineq <- function(x) 1+x[1]-x[2]
res <- optimNLOPTR(,fun=funSphere,lower=c(-10,-20),upper=c(20,8),control=contr) 
res


SPOT documentation built on June 26, 2022, 1:06 a.m.