Skip to main content

Module minpack

Module minpack 

Source
Expand description

MINPACK’s Levenberg-Marquardt method (lmder and lmdif, Moré 1978), as SciPy’s optimize.leastsq and optimize.root(method="lm") call it: nonlinear least squares min ‖F(x)‖², F: ℝⁿ → ℝᵐ, m ≥ n, and so also the roots of square systems.

See the book entry Levenberg-Marquardt for systems, mixed-integer programming and truncated Newton.

Structs§

LmOptions
Options for leastsq and root_lm, with SciPy’s leastsq defaults.
LmResult
The result of leastsq.

Functions§

leastsq
Minimises ‖F(x)‖² by MINPACK’s Levenberg-Marquardt method (SciPy’s leastsq; lmder with an analytic Jacobian, lmdif with forward differences). Each iteration factorises the Jacobian J P = Q R once, then finds by lmpar the damping λ whose step min ‖J p + F‖² + λ‖D p‖² fits the trust region ‖D p‖ ≤ Δ, with D the running maximum of the column norms of J (MINPACK’s mode = 1); Δ grows or shrinks with the ratio of actual to predicted reduction. jac returns the m × n Jacobian by rows.
root_lm
A root of the square system F(x) = 0 by MINPACK’s Levenberg-Marquardt method (SciPy’s root(method="lm")): leastsq on ‖F‖². Converged when MINPACK stops on its ftol or xtol test (info 1–4) with ‖F‖∞ at most 1e-8; a local minimum of ‖F‖ that is not a root is reported as not converged.

Type Aliases§

JacobianFn
An analytic Jacobian for leastsq and root_lm: the m × n matrix ∂Fᵢ/∂xⱼ by rows.