Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1136

BinomialDistribution deals with degenerate cases incorrectly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Labels:

      Description

      The following calculation returns false results:

      new BinomialDistribution(0, 0.01).logProbability(0)

      It evaluates to Double.NaN when it should be 0 (cf., for example, "dbinom(0, 0, 0.01, log=T)" in R).

      I attach a patch dealing with the problem. The patch also adds a test for this bug.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dievsky Aleksei Dievskii
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: