Version: | 1.0-1 |
Title: | 'optimx' Plug-in for the 'R' Optimization Infrastructure |
Description: | Enhances the R Optimization Infrastructure ('ROI') package with the 'optimx' package. |
Imports: | methods, stats, utils, ROI (≥ 1.0-0), optimx |
Suggests: | BB, ucminf, minqa, dfoptim, lbfgsb3c, lbfgs, subplex |
License: | GPL-3 |
URL: | https://roigrp.gitlab.io, https://gitlab.com/roigrp/solver/ROI.plugin.optimx |
NeedsCompilation: | no |
Packaged: | 2023-07-06 15:27:16 UTC; f |
Author: | Florian Schwendinger [aut, cre] |
Maintainer: | Florian Schwendinger <FlorianSchwendinger@gmx.at> |
Repository: | CRAN |
Date/Publication: | 2023-07-06 23:30:06 UTC |
Banana
Description
The following example is also known as Rosenbrock's banana function (https://en.wikipedia.org/wiki/Rosenbrock_function).
minimize \ f(x) = 100 (x_2 - x_1^2)^2 + (1 - x_1)^2
Solution: c(1, 1)
Examples
library(ROI)
f <- function(x) {
return( 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 )
}
f.gradient <- function(x) {
return( c( -400 * x[1] * (x[2] - x[1] * x[1]) - 2 * (1 - x[1]),
200 * (x[2] - x[1] * x[1])) )
}
x <- OP( objective = F_objective(f, n = 2L, G = f.gradient),
bounds = V_bound(ld = -3, ud = 3, nobj = 2L) )
nlp <- ROI_solve(x, solver="optimx", start=c(-1.2, 1), method = "Rvmmin")
nlp
## Optimal solution found.
## The objective value is: 4.979684e-30
solution(nlp)
## [1] 1 1