Skip to main content

Module linear

Module linear 

Expand description

Dense linear algebra and the vector least-squares step.

The scalar root-finders live in solve; this is what the problems with more than one unknown need. Both are small and dense on purpose: a calibration Jacobian is one pillar per rung and a parametric curve fit is four to six parameters, so the matrices here are tens of entries and the cost is not where anything is slow.

StructsΒ§

Fitted πŸ”’
A converged fit: the parameters, the residual norm, and the work it took.

EnumsΒ§

FitFailure πŸ”’
Why a least-squares fit produced no parameters.

ConstantsΒ§

FIT_ITERATION_CAP πŸ”’
The Levenberg-Marquardt cap. A four-to-six parameter fit from a sensible start converges in tens of steps; reaching this is a reported failure, not a silently returned iterate.
GRADIENT_TOLERANCE πŸ”’
First-order optimality: the fit has converged β€” after one final step β€” when the residual is this close to orthogonal to every Jacobian column β€” the largest |Jₐᡀr| / (β€–Jₐ‖·‖rβ€–), the cosine MINPACK calls gtol.

FunctionsΒ§

inverse πŸ”’
The inverse of a square matrix by Gauss-Jordan elimination with partial pivoting, or None when it is singular to working precision.
levenberg_marquardt πŸ”’
Levenberg-Marquardt over a parameter vector.
norm2 πŸ”’
The Euclidean norm of a residual vector.
normal_equations πŸ”’
Jα΅€J and Jα΅€r, both p-sized β€” the matrices this method inverts are the parameter count square, never the bond count. Jα΅€J is symmetric, so one triangle is accumulated and mirrored.
stationary πŸ”’
Converged in the gradient (GRADIENT_TOLERANCE): at a minimum with a non-zero residual β€” every overdetermined fit β€” the residual is orthogonal to the Jacobian’s columns. A column that does not move the residual at all has nothing to say and is skipped rather than divided by.