commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] Commented: (MATH-540) AbstractIntegerDistribution.inverseCumulativeProbability(...) Bug
Date Sun, 06 Mar 2011 06:39:45 GMT

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

Phil Steitz commented on MATH-540:
----------------------------------

I see now that there actually does appear to be an error in the javadoc.  The implementation
really returns the largest x such that p(X <= x) <= p.  In the discrete case, <=
matters and I think both inequalities in the javadoc should be changed.

In your example, if the probability distribution vanishes outside 0, 1, 2, 3 and puts .25
mass on each of these values, the inverse cumulative probability function evaluated at .0001
should be -1, as this is the largest value such that 
p(X <= x) <= .0001.

If you fix your distribution so that both probability and cumulativeProbability return correct
values (rather than throwing NPEs) outside of the mass values, you should get -1 returned.

> AbstractIntegerDistribution.inverseCumulativeProbability(...) Bug
> -----------------------------------------------------------------
>
>                 Key: MATH-540
>                 URL: https://issues.apache.org/jira/browse/MATH-540
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Ole Ersoy
>             Fix For: 3.0
>
>         Attachments: DummyDiscreteDistribution.java, DummyDiscreteDistributionTest.java
>
>
> The AbstractIntegerDistribution.inverseCumulativeProbability(...) function attempts to
decrement the lower bound of discrete distributions to values that go below the lower bound.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message