Expand description
spectrafit-levenberg-marquardt — the Levenberg–Marquardt family of solvers.
This crate is one method on the graph-agnostic
spectrafit-trust-region framework: it owns the
classic LM outer loop (Nielsen λ/ν damping, gain-ratio acceptance, Moré
column scaling) and the regime-adaptive damped Gauss–Newton step
(normal-equations + Cholesky, or thin-SVD secular), and layers two opt-in
variants on the same loop:
- TRF — Coleman–Li bound scaling folded into the damping
(
StrategyConfig::bound_scaling). - geodesic — Transtrum/Sethna second-order acceleration
(
StrategyConfig::geodesic).
The shared problem contract (TrustRegionProblem) and outcome types
(Report, Termination) live in the framework crate and are re-exported
here, so a consumer needs only a spectrafit-levenberg-marquardt dependency
for the full LM API surface.
Structs§
- Report
- Outcome of a solve. The optimised parameters live in the
problem(read viaTrustRegionProblem::params); this only carries diagnostics. - Step
Output - A computed trial step and the cost reduction the linear model predicts for it.
- Strategy
Config - Tuning for a single Levenberg–Marquardt solve (covers LM, TRF and geodesic).
Enums§
- Step
Error - Why a step could not be computed for the current
λ. - Step
Factor - A once-per-outer-iteration factorization of the (column-scaled) Jacobian,
reused across every
λtrial and by geodesic acceleration. This is the key to keeping the innerλsearch cheap: theO(m·p²)work (formingJᵀJ, or the thin SVD ofJ) happens once; eachλtrial is then onlyO(p³)(Cholesky) orO(p²)(closed form). - Step
Kind - Which linear-algebra path the step uses. Chosen per-fit by
select_regime. - Termination
- Why the solve stopped.
Traits§
- Trust
Region Problem - A weighted nonlinear least-squares problem driven by the trust-region core.
Functions§
- factorize
- Factor the step operator once for the current Jacobian and column scaling.
diag(D) is the per-iteration damping scale; for the SVD path it is baked into the factorization (J̃ = J/D), for the NE path it is applied perλ. - minimize
- Minimise
½‖r(p)‖²over the free parameters ofproblemwith Levenberg–Marquardt. - select_
regime - Choose the step factorization path from the problem shape.