[
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