Skip to content

Stabilize hyperspherical UKF arbitrary-noise weights - #4288

Closed
FlorianPfaff wants to merge 17 commits into
mainfrom
agent/stabilize-hyperspherical-ukf-noise-weights-20260713
Closed

Stabilize hyperspherical UKF arbitrary-noise weights#4288
FlorianPfaff wants to merge 17 commits into
mainfrom
agent/stabilize-hyperspherical-ukf-noise-weights-20260713

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • normalize arbitrary-noise weights after scaling by their maximum finite value
  • prevent overflow when individually finite weights have a non-finite direct sum
  • reject empty arbitrary-noise supports with a clear boundary error
  • add focused regressions for maximum finite weights and empty support

Bug

HypersphericalUKF.predict_nonlinear_arbitrary_noise() normalized weights with

noise_weights / noise_weights.sum()

For valid positive finite weights near np.finfo(float).max, the sum overflowed to infinity. The normalized weights collapsed to zero; the subsequent Cartesian-product weights were divided by zero and the predicted mean/covariance became non-finite.

Fix

First divide all positive weights by their maximum. The scaled weights lie in (0, 1], so their sum remains finite for practical sample counts. Dividing by that scaled sum gives the same mathematical normalized weights without overflow.

The method now also rejects an empty weight vector before attempting normalization.

Validation

  • isolated numerical reproduction confirms the old direct sum overflows for two maximum finite weights
  • regression runs the prediction under np.errstate(over="raise", invalid="raise", divide="raise") and verifies the expected unit mean and zero covariance
  • regression verifies an empty noise support raises a parameter-specific ValueError
  • branch comparison against main: two commits ahead, zero behind; implementation diff is three added lines

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 21.68s
✅ JSON prettier 7 0 0 0 1.47s
✅ JSON v8r 7 0 0 3.58s
✅ MARKDOWN markdownlint 68 0 0 0 1.95s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.81s
✅ PYTHON black 1489 182 0 0 88.33s
✅ PYTHON isort 1489 327 0 0 2.53s
✅ REPOSITORY betterleaks yes no no 2.49s
✅ REPOSITORY checkov yes no no 52.11s
✅ REPOSITORY gitleaks yes no no 14.19s
✅ REPOSITORY git_diff yes no no 0.35s
✅ REPOSITORY secretlint yes no no 58.97s
✅ REPOSITORY syft yes no no 5.32s
✅ REPOSITORY trivy-sbom yes no no 5.98s
✅ REPOSITORY trufflehog yes no no 31.36s
✅ YAML prettier 11 0 0 0 0.72s
✅ YAML v8r 11 0 0 11.31s
✅ YAML yamllint 11 0 0 0.59s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.6.0 --custom-flavor-setup --custom-flavor-linters PYTHON_BLACK,PYTHON_ISORT,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_BETTERLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff
FlorianPfaff force-pushed the agent/stabilize-hyperspherical-ukf-noise-weights-20260713 branch from aa4e75a to 5165686 Compare July 13, 2026 16:33
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.

1 participant