Displaying 1 result from an estimated 1 matches for "dbanana".
Did you mean:
banana
2005 Dec 04
1
Understanding nonlinear optimization and Rosenbrock's banana valley function?
...nonlinear regression, but these difficulties don't affect "nlm" or
"nlminb" until the hessian is provided analytically (with R 2.2.0 under
Windows XP):
nlm(banana, c(-1.2, 1)) # found the minimum in 23 iterations
nlminb(c(-1.2, 1), banana)# found the min in 35 iterations
Dbanana <- function(x){
c(-400*x[1]*(x[2] - x[1]^2) - 2*(1-x[1]),
200*(x[2] - x[1]^2))
}
banana1 <- function(x){
b <- 100*(x[2]-x[1]^2)^2+(1-x[1])^2
attr(b, "gradient") <- Dbanana(x)
b
}
nlm(banana1, c(-1.2, 1)) # solved the problem in 24 iterations
nlminb(c(-1.2, 1)...