You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by zhanzhi hu <mi...@gmail.com> on 2005/08/17 00:12:38 UTC
[Math] HypergeometricDistributionImpl cumulativeProbability calculation overflown
Hi all, for all that might use this class:
several things I found when using this class to calculate the
cumulative probability. I attached my code FYI. three things:
1. when I used my code to calculate the cumulativeProbability(50) of
5000 200 100 (Population size, number of successes, sample size),
result was greater than 1 (1.0000000000134985);
2. when I calculated cumulativeProbability(50) and
cumulativeProbability(51) for the distribution 5000 200 100, I got the
same results, but it should have been different;
2. the cumulativeProbability(x) returns "for this distribution, X,
P(X<=x)", but most of the time (at least in my case) what I care about
is the upper tail (X>=x). based on the above findings, I can't simply
use 1-cumulativeProbability(x-1) to get what I want.
here's what I think might be related to the problem: since the
cumulativeProbability is calculating the lower tail (X<=x), a
distribution like above often has this probability very close to 1;
thus it's difficult to record a number that = 1-1E-50 'cause all you
can do is record sth like 0.9999..... and further digits will be
rounded. to avoid this, I suggest adding a new function to calculate
upper tail or change this to calculate x in a range like (n<=x<=m), in
addition to fix the overflow of the current function.
thank you for your patience to get here. I'm a newbie but I've asked
Java experts in our lab about this. looking into the source really
isn't up for me......hope someone can fix it, :)
Re: [Math] HypergeometricDistributionImpl cumulativeProbability calculation overflown
Posted by zhanzhi hu <mi...@gmail.com>.
thanks for the tip. for all that might be interested in this bug, I've
reported to bugzilla as Bug 36215.
On 8/16/05, sebb <se...@gmail.com> wrote:
> On 16/08/05, zhanzhi hu <mi...@gmail.com> wrote:
> > Hi all, for all that might use this class:
> >
> > several things I found when using this class to calculate the
> > cumulative probability. I attached my code FYI. three things:
>
> The code did not reach the list.
>
> May I suggest you create a Bugzilla issue, and attach the code there?
>
> http://issues.apache.org/bugzilla/enter_bug.cgi?product=Commons
>
> It's a lot easier to keep track of bugs there than in mailing lists.
>
> [snip]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [Math] HypergeometricDistributionImpl cumulativeProbability calculation overflown
Posted by sebb <se...@gmail.com>.
On 16/08/05, zhanzhi hu <mi...@gmail.com> wrote:
> Hi all, for all that might use this class:
>
> several things I found when using this class to calculate the
> cumulative probability. I attached my code FYI. three things:
The code did not reach the list.
May I suggest you create a Bugzilla issue, and attach the code there?
http://issues.apache.org/bugzilla/enter_bug.cgi?product=Commons
It's a lot easier to keep track of bugs there than in mailing lists.
[snip]
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org