You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Alex Herbert <al...@gmail.com> on 2021/07/30 16:17:33 UTC

[STATISTICS] HypergeometricDistribution has a legacy redundant method

The HypergeometricDistribution defines

/** returns {@code P(X >= x)} */
public double upperCumulativeProbability(int x)

This was present in Commons Math 3 and so was ported to the new stats
project.

We now have for all distributions:

/** returns {@code P(X > x)} */
double survivalProbability(int x)

I suggest removing the upperCumulativeProbability method from
the HypergeometricDistribution. It computes a different value (as it
includes the input value x) but it is largely redundant due to the survival
probability function. It value can be replicated using:

HypergeometricDistribution d;
int x;
double p = d.survivalProbability(x) + d.probability(x);

I am not aware of an explicit use for this upper cumulative probability
function.

Alex

Re: [STATISTICS] HypergeometricDistribution has a legacy redundant method

Posted by Gilles Sadowski <gi...@gmail.com>.
Le ven. 30 juil. 2021 à 18:17, Alex Herbert <al...@gmail.com> a écrit :
>
> The HypergeometricDistribution defines
>
> /** returns {@code P(X >= x)} */
> public double upperCumulativeProbability(int x)
>
> This was present in Commons Math 3 and so was ported to the new stats
> project.
>
> We now have for all distributions:
>
> /** returns {@code P(X > x)} */
> double survivalProbability(int x)
>
> I suggest removing the upperCumulativeProbability method from
> the HypergeometricDistribution.

+1

Thanks,
Gilles

> It computes a different value (as it
> includes the input value x) but it is largely redundant due to the survival
> probability function. It value can be replicated using:
>
> HypergeometricDistribution d;
> int x;
> double p = d.survivalProbability(x) + d.probability(x);
>
> I am not aware of an explicit use for this upper cumulative probability
> function.
>
> Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org