Skip to content

Take the Levenberg-Marquardt step from the Jacobian, not the normal matrix - #536

Merged
matthewholman merged 2 commits into
mainfrom
fix/nongrav-qr-solve
Sep 3, 2026
Merged

Take the Levenberg-Marquardt step from the Jacobian, not the normal matrix#536
matthewholman merged 2 commits into
mainfrom
fix/nongrav-qr-solve

Conversation

@matthewholman

Copy link
Copy Markdown
Collaborator

Closes #535.

Replaces the normal-equation solve with a Householder QR of the augmented weighted Jacobian,

min || [ √W B ; √λ I ] dX − [ −√W r ; 0 ] ||

which is the same damped step with the condition number no longer squared. A sequential-update prior (#419) enters exactly, as Cholesky rows. BᵀWB is still formed for the covariance and the conditioning check.

Full suite green (549 passed). Cross-check: solving the normal equations after Jacobi equilibration gives bit-identical A2 on all seven test fits, so both routes reach the same least-squares solution.

Two follow-ups this exposes are filed separately: the weak-constraint guard tests the whole correlation matrix rather than the non-grav direction, and the 1e-15 A2 placeholder is not dynamically negligible.

🤖 Generated with Claude Code

matthewholman and others added 2 commits September 3, 2026 16:53
…atrix

Forming B^T W B squares the condition number of the least-squares problem.
For a six-parameter orbit that is survivable, but adding a non-gravitational
amplitude is not: A2 is of order 1e-14 au/day^2 and shares an unscaled matrix
with positions of order 1 au, so on (6489) Golevka cond(sqrt(W) B) = 2.6e10
becomes cond(B^T W B) = 9.2e19 -- four orders past what double precision
resolves. The solve then rank-truncates without complaint: the three position
components of the step come back as exactly zero and the non-grav amplitude
never leaves its seed.

Solve the equivalent damped least-squares problem

    min || [ sqrt(W) B ; sqrt(lambda) I ] dX - [ -sqrt(W) r ; 0 ] ||

by Householder QR instead. The step is the same one; the condition number is
merely no longer squared. A sequential-update prior (issue #419) enters
exactly, as Cholesky rows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@kjnapier kjnapier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Joint state + non-gravitational fits return a rank-truncated step

2 participants