Restore NB2 zero-mean padding in NegativeBinomial observation paths#831
Draft
Copilot wants to merge 3 commits into
Draft
Restore NB2 zero-mean padding in NegativeBinomial observation paths#831Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/CDCgov/PyRenew/sessions/3e268fdd-875d-42cb-8928-98bb74275032 Co-authored-by: dylanhmorris <8032117+dylanhmorris@users.noreply.github.com>
Agent-Logs-Url: https://github.com/CDCgov/PyRenew/sessions/3e268fdd-875d-42cb-8928-98bb74275032 Co-authored-by: dylanhmorris <8032117+dylanhmorris@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix negative binomial tests and add zero-padding
Restore NB2 zero-mean padding in NegativeBinomial observation paths
May 19, 2026
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.
Zero-mean
NegativeBinomial2support in upstream Poisson handling did not resolve NB2 behavior in PyRenew’s observation paths.NegativeBinomialNoiseandNegativeBinomialObservationstill produced invalid (NaN) log-probabilities at exact zero means.Regression coverage for zero-mean NB2
mean == 0andobs == 0.Reintroduced epsilon mean padding in NB2 call sites
pyrenew/observation/noise.py(NegativeBinomialNoise.sample)pyrenew/observation/negativebinomial.py(NegativeBinomialObservation.sample)dist.NegativeBinomial2.Documented numerical-stability rationale inline
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
releases.astral.sh/home/REDACTED/.local/bin/uv /home/REDACTED/.local/bin/uv sync(dns block)If you need me to access, download, or install something from one of these locations, you can either: