This function performs variable neighborhood trust region search.
vntrs(
f,
npar,
minimize = TRUE,
init_runs = 5L,
init_min = -1,
init_max = 1,
init_iterlim = 20L,
neighborhoods = 5L,
neighbors = 5L,
beta = 0.05,
iterlim = 100L,
tolerance = 1e-06,
inferior_tolerance = 1e-06,
time_limit = NULL,
cores = 1L,
lower = NULL,
upper = NULL,
collect_all = FALSE,
quiet = TRUE
)A data.frame summarizing the identified optima or NULL if none
could be determined.
[function]
A function, returning either
a numeric objective value or
a list with element value and optional gradient and
hessian components
for a numeric parameter vector. Missing derivatives are approximated
by finite differences.
[integer(1)]
The number of parameters of f.
[logical(1)]
Minimize f?
[integer(1)]
Number of random starting points for the initialization stage.
[numeric(1)]
Lower and upper bound for the uniform sampling range during initialization.
[integer(1)]
Maximum iterations of the trust-region method during initialization.
[integer(1)]
Number of neighborhood expansions to perform.
[integer(1)]
Number of neighboring points drawn in each neighborhood.
[numeric(1)]
Non-negative scaling factor that controls the neighborhood expansion.
[integer(1)]
Maximum iterations of the trust-region method during the main search.
[numeric(1)]
Minimum distance between optima candidates to consider them distinct.
[numeric(1)]
Maximum allowed difference from the best known objective value when deciding
if a local optimum should be discarded early.
[integer(1) | NULL]
Optional time limit (in seconds) for the search. If reached, the search stops
early with a warning.
[integer(1)]
Number of CPU cores used for parallel evaluation.
[numeric(npar) | NULL]
Optional lower and upper parameter bounds.
[logical(1)]
Keep every converged local optimum even if it is inferior to the best known
solution and disable early stopping?
[logical(1)]
Suppress messages?
Bierlaire et al. (2009) "A Heuristic for Nonlinear Global Optimization" tools:::Rd_expr_doi("10.1287/ijoc.1090.0343").
rosenbrock <- function(x) 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2
vntrs(f = rosenbrock, npar = 2)
Run the code above in your browser using DataLab