bobyqa_rosen_test2: Example 0b: Minimize Rosenbrock function using bobyqa

View source: R/RcppExports.R

bobyqa_rosen_test2R Documentation

Example 0b: Minimize Rosenbrock function using bobyqa

Description

Minimize Rosenbrock function using bobyqa and expect a normal exit from bobyqa. Allows for user input.

Usage

bobyqa_rosen_test2(start, lower, upper)

Arguments

start

Starting values of the algorithm.

lower

Lower bounds of the parameters.

upper

Upper bounds of the parameters.

Value

No return value, called for side effects.

Examples

fr <- function(x) {   ## Rosenbrock Banana function
 x1 <- x[1]
 x2 <- x[2]
 100 * (x2 - x1 * x1)^2 + (1 - x1)^2
}
(x1 <- minqa::bobyqa(c(1, 2), fr, lower = c(0, 0), upper = c(4, 4)))
## => optimum at c(1, 1) with fval = 0
str(x1) # see that the error code and msg are returned

## corresponding C++ implementation:
bobyqa_rosen_test2(c(1,2),c(0,0),c(4,4))

rminqa documentation built on Jan. 12, 2026, 9:06 a.m.