Skip to content

Add Normalized Innovation Squared (NIS) Chi-Squared test + OD dashboard#533

Merged
ChristopherRabotin merged 2 commits intomasterfrom
feat/nis-chi-square-gh-128
May 2, 2026
Merged

Add Normalized Innovation Squared (NIS) Chi-Squared test + OD dashboard#533
ChristopherRabotin merged 2 commits intomasterfrom
feat/nis-chi-square-gh-128

Conversation

@ChristopherRabotin
Copy link
Copy Markdown
Member

Summary

Add Normalized Innovation Squared (NIS) Chi-Squared test; summarize a whole OD run into a single dashboard showing the whitened residual ratios by status (accepted/rejected) and by tracker, the auto-correlation by tracker with the sigmas, the histogram of these whitened residuals, and the QQ plot of these whitened residuals. In "ScalarOD", there will only ever be a single whitened residual: it scales with the dimension of the simultaneously processed measurements.

The SNC is also now correctly disabled when the delta_t is greater than the disable time. Exports the whitened residuals, dimensionless quantity.

Closes #128

Architectural Changes

No change

New Features

  • Add the NIS test to the OD solution
  • Export whitened residuals from OD solution

Improvements

  • Huge improvements to the OD dashboard, summarizes everyone one needs in three plots now!

Bug Fixes

  • SNC correctly disabled after the desired disable time.

Testing and validation

Ran the 06 example a bunch of times with various inputs.

Documentation

This PR does not primarily deal with documentation changes.

The SNC is also now correctly disabled when the delta_t is greater than the disable time.
Exports the whitened residuals, dimensionless quantity.

Closes #128
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Visit the preview URL for this PR (updated for commit 8d22421):

https://nyx-rustdoc--pr533-feat-nis-chi-square-s3ahr3fy.web.app

(expires Sat, 09 May 2026 15:23:12 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: d8e2a55934352d850c15d11866c39eb2d2e029be

@ChristopherRabotin
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces whitened residuals and Normalized Innovation Squared (NIS) consistency tests to the orbit determination process. Key changes include updating the Residual struct to store whitened innovations, implementing a Chi-squared test for filter consistency, and enhancing Parquet export/import logic to include these new metrics. Additionally, the PR significantly upgrades plotting utilities to support comprehensive residual analysis, including QQ plots and autocorrelation. Feedback focuses on resolving a naming mismatch between export and import logic for whitened residuals, correcting a bug in the degrees of freedom calculation for the NIS test, and improving the robustness of statistical calculations by leveraging existing library functions.

Comment thread src/od/process/solution/export.rs
Comment thread src/od/process/solution/export.rs
Comment thread src/od/process/solution/stats.rs Outdated
Comment thread src/od/estimate/residual.rs
Comment thread src/od/process/solution/stats.rs Outdated
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces whitened residuals to the orbit determination process, enabling more advanced statistical validation including a Chi-squared test for Normalized Innovation Squared (NIS) consistency. It also significantly enhances the residual plotting utilities with QQ plots and autocorrelation analysis, updates example configurations, and improves progress logging. The review feedback correctly identifies a logic error in the NIS consistency test regarding the calculation of degrees of freedom when measurements are rejected. It also points out an inconsistency in the export naming convention for whitened residuals that would break the import functionality, providing suggestions to align it with existing residual types.

Comment thread src/od/process/solution/stats.rs Outdated
Comment thread src/od/process/solution/export.rs
Comment thread src/od/process/solution/export.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

❌ Patch coverage is 42.46575% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.02%. Comparing base (bfc543f) to head (8d22421).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/od/process/solution/stats.rs 6.45% 29 Missing ⚠️
src/od/estimate/residual.rs 15.38% 11 Missing ⚠️
src/od/kalman/filtering.rs 66.66% 1 Missing ⚠️
src/od/snc.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #533      +/-   ##
==========================================
- Coverage   78.17%   78.02%   -0.16%     
==========================================
  Files         102      102              
  Lines       16031    16098      +67     
==========================================
+ Hits        12532    12560      +28     
- Misses       3499     3538      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChristopherRabotin ChristopherRabotin merged commit 59b23df into master May 2, 2026
10 of 15 checks passed
@ChristopherRabotin ChristopherRabotin deleted the feat/nis-chi-square-gh-128 branch May 2, 2026 20:01
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.

Implement Chi-Squared Testing, Normalized Estimation Error Squared (NEES) and Normalized Innovation Squared (NIS) for tuning the Kalman filter

1 participant