fix(estimation): let underflowed particles recover - #276
Draft
fzlzjerry wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #205
What & why
When normalization rounds an individual particle's weight to zero, the next update currently feeds
ln(0)into its log-score and makes that particle permanently impossible. UseT::MIN_POSITIVEonly for an exactly zero prior weight, preserving the existing numerical path for every representable weight while allowing a later observation to revive an underflowed particle. The public-API regression drives one particle to a displayed zero, reverses the evidence without resampling, and verifies that it becomes dominant.Checklist
cargo test+cargo clippy --all-targetsclean locallyunwrap/expect/panicon library paths (typed errors instead)Validation
cargo test -p multicalc --features alloc estimation::particle_filtercargo test -p multicalccargo test -p multicalc --features alloccargo test -p multicalc --all-features --doccargo clippy -p multicalc --all-targets --features alloc -- -D warningscargo fmt --all -- --checkRUSTDOCFLAGS='-D warnings' cargo doc -p multicalc --no-deps --all-featuresgit diff --check