BFGS in inverse-Hessian form with a strong-Wolfe line search (c1 = 1e-4,
c2 = 0.9), H0 = I rescaled by y's / y'y before the first update; stops when
max |g_i| <= gtol.
Usage
BfgsMinimize(f, x0, grad = NULL, gtol = 1e-08, max_iter = 1000)
Arguments
- f
Objective.
- x0
Starting point.
- grad
Gradient function; central differences when NULL.
- gtol
Gradient tolerance.
- max_iter
Iteration cap.
Value
list(x, fun, grad, n_iter, n_fev, converged).
References
Nocedal, J. and Wright, S. J. (2006). Numerical Optimization,
2nd ed., Algorithm 6.1.
Examples
BfgsMinimize(function(x) (1 - x[1])^2 + 100 * (x[2] - x[1]^2)^2, c(-1.2, 1))$x
#> [1] 1 1