# nlls_gram

> Metric-aware underdetermined Levenberg-Marquardt nonlinear least squares for JAX pytrees (residual count m << parameter count n). Per-step update(), a jitted solve() loop with resettable hyperparameters and callbacks, implicit differentiation with respect to external parameters p, and pluggable parameter-space metrics (kernel/RKHS).

## Docs

- [Tuning guide — read first for solver selection and hyperparameter heuristics](https://highdimensionaleconlab.github.io/nlls_gram/tuning_guide/)
- [Main docs — API contracts, math, linear solvers, performance notes](https://highdimensionaleconlab.github.io/nlls_gram/)
- [Callbacks and cookbook — solve-loop callback contract, resettable hyperparameters, recipes](https://highdimensionaleconlab.github.io/nlls_gram/callbacks/)
- [Multi-start — retry failed solves from fresh draws or race starts in parallel under vmap; draw/accept hooks, key schedule, winner-only implicit AD](https://highdimensionaleconlab.github.io/nlls_gram/multi_start/)
- [Metrics — Metric callback contract, cholesky helper, dense and matrix-free examples](https://highdimensionaleconlab.github.io/nlls_gram/metrics/)
- [Utilities — tridiagonal/state-space-Matérn/shifted-matvec/diagonal/block-diagonal metric constructors; Sherman-Morrison, Woodbury, identity, and randomized Nyström (FTU) preconditioners serving both required CG hooks, plus the dual-only padded-residual helper](https://highdimensionaleconlab.github.io/nlls_gram/utilities/)
- [Implicit differentiation — JVP/VJP with respect to p, minimum-norm tangents, aux outputs](https://highdimensionaleconlab.github.io/nlls_gram/implicit_ad/)
- [Square systems — solve-only damped-Newton root solver for square nonsingular systems (DAE stage solves), direct augmented-QR step, implicit AD via J_x xdot = -J_p pdot](https://highdimensionaleconlab.github.io/nlls_gram/square_systems/)
- [Metric Gauss-Newton — minimum-norm math and kernel metric choices](https://highdimensionaleconlab.github.io/nlls_gram/gauss_newton/)
