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 callsgtol.
FunctionsΒ§
- inverse π
- The inverse of a square matrix by Gauss-Jordan elimination with partial
pivoting, or
Nonewhen 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α΅JandJα΅r, both p-sized β the matrices this method inverts are the parameter count square, never the bond count.Jα΅Jis 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.