J.Pietschmann wrote:
> Phil Steitz wrote:
>
>> 1) Decide what to do about inverse cumulative probabilities where p =
>> 1 (easy solution is to document and throw)
>
>
> Nearly +1
>
My own "nearly +1" on this just turned to 1. After looking some more at
the code and thinking some more, I think that both p=1 and p=0 should be
handled correctly in all cases. The difficult cases are when the
probability density function has unbounded support. Here is what I
propose for the values of inverseCumulativeProbability() at p=0 and p=1
for current distributions. Unless otherwise noted, these values are
intented to be independent of distribution parameters.
Distribution p=0 p=1

Binomial 0 Integer.MAX_VALUE
Chisquare 0 Double.POSITIVE_INFINITY
Exponential 0 Double.POSITIVE_INFINITY
F 0 Double.POSITIVE_INFINITY
Gamma 0 Double.POSITIVE_INFINITY
HyperGeometric 0 finite, parameterdependent
Normal Double.NEGATIVE_INFINITY Double.POSITIVE_INFINITY
T Double.NEGATIVE_INFINITY Double.POSITIVE_INFINITY
Other than the value for Chisquare with p=1 (which causes R to hang),
these values are consistent with what R returns using the q* functions.
It might be more convenient to return Double.MAX_VALUE, Double.MAX_VALUE
in place of the INFINITY's (since then we could just use
getDomainLowerBound at 0 and 1) but this would not be correct
mathematically. If there are no objections, I will find a way to get the
values above returned.
Phil

To unsubscribe, email: commonsdevunsubscribe@jakarta.apache.org
For additional commands, email: commonsdevhelp@jakarta.apache.org
