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

BinomialDistribution deals with degenerate cases incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3
    • 3.4
    • None

    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

        1. BINOMIAL_DEGENERATE.patch
          2 kB
          Aleksei Dievskii

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: