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

Commits on Sep 29, 2022

  1. Configuration menu
    Copy the full SHA
    8a89874 View commit details
    Browse the repository at this point in the history
  2. Fix sampling from the negative binomial distribution

    Fix the rate parameter of the gamma distribution used to represent
    the negative binomial distribution as Poisson mixture.
    Arlofin committed Sep 29, 2022
    Configuration menu
    Copy the full SHA
    d1fb730 View commit details
    Browse the repository at this point in the history
  3. Avoid code duplication in sampling from the negative binomial distrib…

    …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.
    Arlofin committed Sep 29, 2022
    Configuration menu
    Copy the full SHA
    8b4cd7a View commit details
    Browse the repository at this point in the history
  4. Disallow success probability p = 0 for negative binomial distribution

    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.
    Arlofin committed Sep 29, 2022
    Configuration menu
    Copy the full SHA
    6a16def View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fe863e6 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2022

  1. Fix the parameter descriptions of the negative binomial distribution

    Use correct XML encoding of the less than operator for the description
    of the range of the p parameter.
    Arlofin committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    c8cebe2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3bd99d4 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2022

  1. Adjust the unit tests of the negative binomial distribution

    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 committed Oct 1, 2022
    Configuration menu
    Copy the full SHA
    d05fab7 View commit details
    Browse the repository at this point in the history