Commons Math
  1. Commons Math
  2. MATH-718

inverseCumulativeProbability of BinomialDistribution returns wrong value for large trials.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2, 3.0
    • Fix Version/s: 3.1
    • Labels:
      None

      Description

      The inverseCumulativeProbability method of the BinomialDistributionImpl class returns wrong value for large trials. Following code will be reproduce the problem.

      System.out.println(new BinomialDistributionImpl(1000000, 0.5).inverseCumulativeProbability(0.5));

      This returns 499525, though it should be 499999.

      I'm not sure how it should be fixed, but the cause is that the cumulativeProbability method returns Infinity, not NaN. As the result the checkedCumulativeProbability method doesn't work as expected.

      1. MATH-718.diff
        4 kB
        Thomas Neidhart

        Issue Links

          Activity

          Yuji Uchiyama created issue -
          Sébastien Brisard made changes -
          Field Original Value New Value
          Assignee Sébastien Brisard [ celestin ]
          Sébastien Brisard made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Sébastien Brisard [ celestin ]
          Fix Version/s 3.1 [ 12317576 ]
          Fix Version/s 4.0 [ 12317577 ]
          Resolution Later [ 7 ]
          Sébastien Brisard made changes -
          Resolution Later [ 7 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Sébastien Brisard made changes -
          Assignee Sébastien Brisard [ celestin ]
          Thomas Neidhart made changes -
          Link This issue relates to MATH-785 [ MATH-785 ]
          Thomas Neidhart made changes -
          Attachment MATH-718.diff [ 12528358 ]
          Thomas Neidhart made changes -
          Attachment MATH-718.diff [ 12528358 ]
          Thomas Neidhart made changes -
          Attachment MATH-718.diff [ 12528359 ]
          Sébastien Brisard made changes -
          Assignee Sébastien Brisard [ celestin ]
          Thomas Neidhart made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 4.0 [ 12317577 ]
          Resolution Fixed [ 1 ]
          Thomas Neidhart made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Yuji Uchiyama
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development