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

Ole Ersoy commented on MATH-540:
--------------------------------

Ooops - Thanks.  

{quote}
...inverse cumulative probability function evaluated at .0001 should be -1, as 
this is the largest value such that 
p(X <= x) <= .0001.
{quote}

It seems to me that users would be better served if it returned 0 and that it 
is also correct to do so.

In the definition we say "For a random variables X whose values are distributed 
according to this distribution...".

Suppose the distribution was for a six sided dice.  One could assert that the 
distribution is only defined for the values 1,2,3,4,5,6.  In this case the 
inverseCumulativeDistribution returns 0, but that does not have any meaning.  
So now developers are forced to define the meaning of 0 for a six sided dice 
implementation.  

In Grad school we were taught the the inverse cumulative distribution is for 
sampling.  So for a six sided dice uniform probabilities less than 1/6 would 
return 1, less than 2/6 would return 2, etc.

With the current implementation for values less than 1/6 we get 0 which is 
meaningless, and the only time we get 6 is when the uniform probability 
argument is 1.

So if someone mistakenly tries to use the inverseCumulativeProbability function 
for sampling the results are going to be wacked.  What is the use case for the 
inverseCumulativeProbability the way it is right now?

> 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

Reply via email to