
Boost : 
From: Johan Råde (rade_at_[hidden])
Date: 20080506 05:56:13
John Maddock wrote:
> This is true of all asymmetric distributions of course, you need to add the
> two tails calculated separately:
>
> cdf(hypergeometric(), n) + cdf(hypergeometric(), total  n)
>
> Ah... wait, because it's discrete, that misses out one value from the right
> tail? So should be:
>
>
> cdf(hypergeometric(), n) + cdf(hypergeometric(), total  n  1) ???
If the distribution is asymmetric you may want neither total  n nor total  n  1.
What you want is
sum/integral of pdf(dist,y) over all y such that pdf(dist,y) <= pdf(dist,x).
You actually have to do a bit of work to find out what the right cutoff is for the other tail.
Johan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk