Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and improve negative binomial distribution #960

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Arlofin
Copy link
Contributor

@Arlofin Arlofin commented Sep 29, 2022

Addresses issues #455, #320 and the remainder of #263.

Fix the rate parameter of the gamma distribution used to represent
the negative binomial distribution as Poisson mixture.
…ution

Make the unchecked sample methods of the Poisson distribution internal
instead of private.
Within the negative binomial sampling, call the Poisson sample method
instead of duplicating the implementation.
The negative binomial distribution is undefined for p = 0
(asymptotically, it reaches infinity, which cannot be represented as
integer). This also avoids unhandled divisions by 0 or other undefined
mathematical operations in the properties and an endless loop in the
sampling method.
Use correct XML encoding of the less than operator for the description
of the range of the p parameter.
Adjust the unit tests after parameter restriction and proper handling
of edge cases:
- Use p = 0.1 instead of p = 0.0
- Add a test case with p = 0.0 in test for invalid parameters
- Add special case in probability validation for p = 1.0 and r = 0.0
@Arlofin
Copy link
Contributor Author

Arlofin commented Nov 14, 2022

Hello @cdrnet,
please let me know whether this PR needs additional work. The CodeQL failure seems to me rather an issue with the analyzer than with my code ("Config file could not be found at expected location. Did the 'init' action fail to start?").

@cdrnet
Copy link
Member

cdrnet commented Nov 14, 2022

Please ignore CodeQL - I've removed it on master in the meantime.

@Arlofin
Copy link
Contributor Author

Arlofin commented Oct 4, 2023

Hi,
are there any plans to ever merge this PR?

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