Skip to main content

Crate spectrafit_levenberg_marquardt

Crate spectrafit_levenberg_marquardt 

Source
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:

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 via TrustRegionProblem::params); this only carries diagnostics.
StepOutput
A computed trial step and the cost reduction the linear model predicts for it.
StrategyConfig
Tuning for a single Levenberg–Marquardt solve (covers LM, TRF and geodesic).

Enums§

StepError
Why a step could not be computed for the current λ.
StepFactor
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: the O(m·p²) work (forming JᵀJ, or the thin SVD of J) happens once; each λ trial is then only O(p³) (Cholesky) or O(p²) (closed form).
StepKind
Which linear-algebra path the step uses. Chosen per-fit by select_regime.
Termination
Why the solve stopped.

Traits§

TrustRegionProblem
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 of problem with Levenberg–Marquardt.
select_regime
Choose the step factorization path from the problem shape.