Examples for 'nloptr::lbfgs'


Low-storage BFGS

Aliases: lbfgs

Keywords:

### ** Examples


flb <- function(x) {
    p <- length(x)
    sum(c(1, rep(4, p-1)) * (x - c(1, x[-p])^2)^2)
}
# 25-dimensional box constrained: par[24] is *not* at the boundary
S <- lbfgs(rep(3, 25), flb, lower=rep(2, 25), upper=rep(4, 25),
           nl.info = TRUE, control = list(xtol_rel=1e-8))
Call:
nloptr(x0 = x0, eval_f = fn, eval_grad_f = gr, lb = lower, ub = upper, 
    opts = opts)


Minimization using NLopt version 2.7.1 

NLopt solver status: 1 ( NLOPT_SUCCESS: Generic success return value. )

Number of Iterations....: 19 
Termination conditions:  stopval: -Inf	xtol_rel: 1e-08	maxeval: 1000	ftol_rel: 0	ftol_abs: 0 
Number of inequality constraints:  0 
Number of equality constraints:    0 
Optimal value of objective function:  368.105912874334 
Optimal value of controls: 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2.109093 4
## Optimal value of objective function:  368.105912874334
## Optimal value of controls: 2  ...  2  2.109093  4

[Package nloptr version 2.0.3 Index]