Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

varmetric

Shifted Limited-memory Variable-metric


Description

Shifted limited-memory variable-metric algorithm.

Usage

varmetric(x0, fn, gr = NULL, rank2 = TRUE, lower = NULL,
  upper = NULL, nl.info = FALSE, control = list(), ...)

Arguments

x0

initial point for searching the optimum.

fn

objective function to be minimized.

gr

gradient of function fn; will be calculated numerically if not specified.

rank2

logical; if true uses a rank-2 update method, else rank-1.

lower, upper

lower and upper bound constraints.

nl.info

logical; shall the original NLopt info been shown.

control

list of control parameters, see nl.opts for help.

...

further arguments to be passed to the function.

Details

Variable-metric methods are a variant of the quasi-Newton methods, especially adapted to large-scale unconstrained (or bound constrained) minimization.

Value

List with components:

par

the optimal solution found so far.

value

the function value corresponding to par.

iter

number of (outer) iterations, see maxeval.

convergence

integer code indicating successful completion (> 0) or a possible error number (< 0).

message

character string produced by NLopt and giving additional information.

Note

Based on L. Luksan's Fortran implementation of a shifted limited-memory variable-metric algorithm.

Author(s)

Hans W. Borchers

References

J. Vlcek and L. Luksan, “Shifted limited-memory variable metric methods for large-scale unconstrained minimization,” J. Computational Appl. Math. 186, p. 365-390 (2006).

See Also

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 <- varmetric(rep(3, 25), flb, lower=rep(2, 25), upper=rep(4, 25),
           nl.info = TRUE, control = list(xtol_rel=1e-8))
## Optimal value of objective function:  368.105912874334
## Optimal value of controls: 2  ...  2  2.109093  4

nloptr

R Interface to NLopt

v1.2.2.2
LGPL-3
Authors
Jelmer Ypma [aut, cre], Steven G. Johnson [aut] (author of the NLopt C library), Hans W. Borchers [ctb], Dirk Eddelbuettel [ctb], Brian Ripley [ctb] (build process on multiple OS), Kurt Hornik [ctb] (build process on multiple OS), Julien Chiquet [ctb], Avraham Adler [ctb] (removal deprecated calls from tests, <https://orcid.org/0000-0002-3039-0703>)
Initial release
2020-07-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.