Skip to content

Fix robust weight queries to use whitened residuals - #2855

Merged
dellaert merged 1 commit into
borglab:developfrom
vera-rubin:fix/robust-weight-whitening
Oct 18, 2026
Merged

dellaert merged 1 commit into
borglab:developfrom
vera-rubin:fix/robust-weight-whitening

Conversation

@vera-rubin

Copy link
Copy Markdown
Contributor

With Cauchy parameter 1, residual (3, 4), and Gaussian sigma 2, Robust::weight() and NoiseModelFactor::weight() return 1/26. The documented whitening contract requires 4/29, since the estimator should see residual (1.5, 2).

auto model = noiseModel::Robust::Create(
    noiseModel::mEstimator::Cauchy::Create(1.0),
    noiseModel::Isotropic::Sigma(2, 2.0));
model->weight(Vector2{3.0, 4.0});  // Should be 4.0 / 29.0.

We now whiten with the underlying noise model before evaluating the robust weight, which also corrects the factor query.

The new regression fails before the fix and passes after, and the existing NoiseModel, NonlinearFactor, and Robust tests pass.

— ChipLab

@dellaert

Copy link
Copy Markdown
Member

Nice. I'll try to get to this early this week.

@dellaert dellaert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks for tracking this down!

@dellaert
dellaert merged commit 08ebac0 into borglab:develop Oct 18, 2026
7 checks passed
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.

2 participants