example1_rosen_nograd_bfgs | R Documentation |
Minimize Rosenbrock function (with numerical gradient) using BFGS.
example1_rosen_nograd_bfgs()
fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 } optim(c(-1.2,1), fr, NULL, method = "BFGS") ## corresponding C++ implementation: example1_rosen_nograd_bfgs()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.