Learn R Programming

rminqa (version 0.2.2)

bobyqa_rosen_x1e: Example 1b: Minimize Rosenbrock function using bobyqa

Description

Minimize Rosenbrock function using bobyqa and expect a normal exit from bobyqa.

Usage

bobyqa_rosen_x1e()

Arguments

Value

No return value, called for side effects.

Examples

Run this code
fr <- function(x) {   ## Rosenbrock Banana function
 x1 <- x[1]
 x2 <- x[2]
 100 * (x2 - x1 * x1)^2 + (1 - x1)^2
}
# check the error exits
# too many iterations
x1e <- minqa::bobyqa(c(1, 2), fr, lower = c(0, 0), upper = c(4, 4), control = list(maxfun=50))
str(x1e)

## corresponding C++ implementation:
bobyqa_rosen_x1e()

Run the code above in your browser using DataLab