In numerical optimization, the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm is an iterative method for solving unconstrained nonlinear optimization problems. Like the related Davidon–Fletcher–Powell method, BFGS determines the descent direction by preconditioning the gradient with curvature information. It does so by gradually improving an approximation to the Hessian matrix of the loss function, obtained only from gradient evaluations (or approximate gradient evaluations) via a generalized secant method. Since the updates of the BFGS curvature matrix do not require matrix inversion, its computational complexity is only , compared to in Newton's method. Also in common use is L-BFGS, which is a limited-memory version of BFGS that is particularly suited to problems with very large numbers of variables (e.g., >1000). The BFGS-B variant handles simple box constraints. The algorithm is named after Charles George Broyden, Roger Fletcher, Donald Goldfarb and David Shanno. Rationale The optimization problem is to minimize , where is a vector in , and is a differentiable scalar function. There are no constraints on the values that can take. The algorithm begins at an initial estimate for the optimal value and proceeds iteratively to get a better estimate at each stage. The search direction pk at stage k is given by the solution of the analogue of the Newton equation: where is an approximation to the Hessian matrix, which is updated iteratively at each stage, and is the gradient of the function evaluated at xk. A line search in the direction pk is then used to find the next point xk+1 by minimizing over the scalar The quasi-Newton condition imposed on the update of is Let and , then satisfies , which is the secant equation. The curvature condition should be satisfied for to be positive definite, which can be verified by pre-multiplying the secant equation with . If the function is not strongly convex, then the condition has to be enforced explicitly e.g. by finding a point xk+1 satisfying the Wolfe conditions, which entail the curvature condition, using line search. Instead of requiring the full Hessian matrix at the point to be computed as , the approximate Hessian at stage k is updated by the addition of two matrices: Both and are symmetric rank-one matrices, but their sum is a rank-two update matrix. BFGS and DFP updating matrix both differ from its predecessor by a rank-two matrix. Another simpler rank-one method is known as symmetric rank-one method, which does not guarantee