4. Newton and Quasi-Newton Methods
Newton methods use a second-order model to choose the search direction; quasi-Newton methods build curvature information from gradient differences. The dense implementations live in the Method enum of minimize, with \(O(n^2)\) resident storage and \(O(n^3)\) factorizations or inversions.
4.1 Newton equations and damping
At \(x_k\), the Newton direction solves the linear system
Method::DampedNewton solves this system and then runs Armijo backtracking. The callback supplies the Hessian with shape \(n\times n\); the entry point checks symmetry.
Method::ModifiedNewton handles indefinite or singular Hessians by shifting:
starting from \(\sigma=|g_k|\) and doubling until a Cholesky factorization succeeds, then solving
The shift scales with the gradient norm, so regularization weakens as the iterate approaches a stationary point.
4.2 Secant condition and inverse-Hessian updates
Write \(s_k=x_{k+1}-x_k\) and \(y_k=g_{k+1}-g_k\). The inverse-Hessian approximation \(B_k\approx H_k^{-1}\) satisfies the secant condition
nlopt4r implements four dense updates:
BFGS (\(\phi=1\)):
DFP (\(\phi=0\)):
SR1:
Broyden convex family (\(0\le\phi\le 1\)), interpolating between DFP and inverse BFGS:
Method::Broyden { phi } gives DFP at \(0\) and inverse BFGS at \(1\).
4.3 Safeguards
The four updates share these rules:
- the initial inverse Hessian is the identity;
- BFGS/DFP/Broyden updates require \(s^\top y>10^{-12}|s||y|\) and \(y^\top B y>0\); a passing pair is applied and symmetrized as \(B\leftarrow (B+B^\top)/2\);
- the SR1 update requires \(|(s-By)^\top y|>10^{-8}|s-By||y|\);
- each iteration checks descent: if \(g^\top d\ge -10^{-12}|g||d|\), the direction becomes \(-g\) and the inverse Hessian resets to the identity.
A failing curvature or definiteness test skips the update and keeps the current inverse model. This is independent of the descent safeguard: when the computed direction fails its descent test, the direction becomes \(-g\) and the inverse model resets to the identity.
4.4 Cost and problem size
| Method | Work per step | Storage | Derivatives |
|---|---|---|---|
| DampedNewton | 1 Hessian + \(O(n^3)\) solve + line search | \(O(n^2)\) | Gradient and Hessian |
| ModifiedNewton | Cholesky attempts + linear solves | \(O(n^2)\) | Gradient and Hessian |
| Bfgs / Dfp / Sr1 / Broyden | rank-one/two update \(O(n^2)\) + line search | \(O(n^2)\) | Gradient |
Chapter 6 covers limited-memory and matrix-free alternatives for large problems.
Software interface
- The
Methodenum andminimize: see chapter 16. - The Hessian callback
Function::with_hessian: see chapter 15. - Line-search settings
Options::line_search: see chapter 2 and chapter 20. - API pages (docs.rs):
minimize,Method,Options.
References
- 马昌凤, 最优化方法及其 Matlab 程序设计 (in Chinese), 2010, chapters 3 and 5.
- C. G. Broyden, “The convergence of a class of double-rank minimization algorithms,” J. Inst. Math. Appl. 6 (1970), 76–90.
- J. Nocedal, S. J. Wright, Numerical Optimization, 2nd ed., 2006, Chapter 6.