Subplex is a variant of Nelder-Mead that uses Nelder-Mead on a sequence of subspaces.
sbplx(
x0,
fn,
lower = NULL,
upper = NULL,
nl.info = FALSE,
control = list(),
...
)
List with components:
the optimal solution found so far.
the function value corresponding to par
.
number of (outer) iterations, see maxeval
.
integer code indicating successful completion (> 0) or a possible error number (< 0).
character string produced by NLopt and giving additional information.
SUBPLEX is claimed to be much more efficient and robust than the original Nelder-Mead while retaining the latter's facility with discontinuous objectives.
This implementation has explicit support for bound constraints via the
method in the Box paper as described on the neldermead
help page.
It is the request of Tom Rowan that reimplementations of his algorithm shall not use the name `subplex'.
T. Rowan, “Functional Stability Analysis of Numerical Algorithms”, Ph.D. thesis, Department of Computer Sciences, University of Texas at Austin, 1990.
subplex::subplex
# Fletcher and Powell's helic valley
fphv <- function(x)
100*(x[3] - 10*atan2(x[2], x[1])/(2*pi))^2 +
(sqrt(x[1]^2 + x[2]^2) - 1)^2 +x[3]^2
x0 <- c(-1, 0, 0)
sbplx(x0, fphv) # 1 0 0
#> $par
#> [1] 1.000000e+00 3.706887e-12 5.858708e-12
#>
#> $value
#> [1] 3.449246e-23
#>
#> $iter
#> [1] 994
#>
#> $convergence
#> [1] 4
#>
#> $message
#> [1] "NLOPT_XTOL_REACHED: Optimization stopped because xtol_rel or xtol_abs (above) was reached."
#>
# Powell's Singular Function (PSF)
psf <- function(x) (x[1] + 10*x[2])^2 + 5*(x[3] - x[4])^2 +
(x[2] - 2*x[3])^4 + 10*(x[1] - x[4])^4
x0 <- c(3, -1, 0, 1)
sbplx(x0, psf, control = list(maxeval = Inf, ftol_rel = 1e-6)) # 0 0 0 0 (?)
#> Warning: NAs introduced by coercion to integer range
#> $par
#> [1] 0.012385093 -0.001238441 0.007823193 0.007827134
#>
#> $value
#> [1] 8.567466e-08
#>
#> $iter
#> [1] 78796
#>
#> $convergence
#> [1] 3
#>
#> $message
#> [1] "NLOPT_FTOL_REACHED: Optimization stopped because ftol_rel or ftol_abs (above) was reached."
#>