commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard (Commented) (JIRA) <>
Subject [jira] [Commented] (MATH-699) inverseCumulativeDistribution fails with cumulative distribution having a plateau
Date Mon, 07 Nov 2011 19:18:51 GMT


Sébastien Brisard commented on MATH-699:

I don't think any of the currently implemented real distributions have this problem. Correct?
Maybe I misunderstood, but in MATH-692 asked for a more precise definition of {{inverseCumulativeProbability}}
as inf{x in R | P(X<=x) >= p}. If we exclude distribution with plateaus, I think that
the current implementation is  satisfactory (but for the use of the wrong tolerance I've already
pointed out). But it was agreed that this implementation should be made more robust. So what
was it exactly that needed improvement? What do you want me to do on this method?

They are initial guesses for where to start when trying to bracket a root. That means they
have to be values that can be fed into the cumulative probability function.
I'm aware of that, but the current solver does fail when {{inverseCumulativeProbability(0)}}
should return -inf, or {{inverseCumulativeProbability(1)}} should return +inf. See for example
the implementation of {{NormalDistributionImpl}}.
    public double inverseCumulativeProbability(final double p)
        if (p == 0) {
            return Double.NEGATIVE_INFINITY;
        if (p == 1) {
            return Double.POSITIVE_INFINITY;
        return super.inverseCumulativeProbability(p);
So currently, people who want to implement a distribution must be aware of the fact that the
default implementation of {{inverseCumulativeProbability}} *must* be overriden. This rather
unusual fact should be made clear in the Javadoc, unless a workaround can be thought of. I
agree the one I proposed was far from perfect.

Remember to consider convergence problems when the actual parameter to inverse cum is close
to or exactly equal to 0 or 1.
Thank you for pointing this out earlier. I do keep this important point in mind. But again,
if we do not widen the scope of this method, I don't see what is required of me (appart from
some cosmetic alterations to the Javadoc).
> inverseCumulativeDistribution fails with cumulative distribution having a plateau
> ---------------------------------------------------------------------------------
>                 Key: MATH-699
>                 URL:
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>            Priority: Minor
>         Attachments:
> This bug report follows MATH-692. The attached unit test fails. As required by the definition
in MATH-692, the lower-bound of the interval on which the cdf is constant should be returned.
This is not so at the moment.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message