You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2012/05/21 00:00:42 UTC

[jira] [Comment Edited] (MATH-718) inverseCumulativeProbability of BinomialDistribution returns wrong value for large trials.

    [ https://issues.apache.org/jira/browse/MATH-718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13279877#comment-13279877 ] 

Thomas Neidhart edited comment on MATH-718 at 5/20/12 9:59 PM:
---------------------------------------------------------------

The attached diff file shows the (preliminary) implementation of the modified Lentz-Thompson algorithm. There are in fact several unit tests that fail now, but this may be related to more accurate results. Relevant tests that use data from R or NIST datasets run successfully.

Need to go through all failing tests and check the reason why they fail with this patch.

Edit: re-uploaded the diff file as it was broken.
                
      was (Author: tn):
    The attached diff files shows the (preliminary) implementation of the modified Lentz-Thompson algorithm. There are in fact several unit tests that fail now, but this may be related to more accurate results. Relevant tests that use data from R or NIST datasets run successfully.

Need to go through all failing tests and check the reason why they fail with this patch.
                  
> inverseCumulativeProbability of BinomialDistribution returns wrong value for large trials.
> ------------------------------------------------------------------------------------------
>
>                 Key: MATH-718
>                 URL: https://issues.apache.org/jira/browse/MATH-718
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.2, 3.0
>            Reporter: Yuji Uchiyama
>            Assignee: Sébastien Brisard
>             Fix For: 3.1, 4.0
>
>         Attachments: MATH-718.diff
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira