
Boost : 
From: Johan Råde (rade_at_[hidden])
Date: 20080505 14:49:43
There is one difficulty with the twosided Fisher exact test.
To calculate a pvalue for the leftsided test,
you take the cdf of the hypergeometric distribution
for the observed value of the test statistica.
I you want to calculate a pvalue for the rightsided test,
then you just take cdf complement for the observed value of the test statistica.
But for a twosided test, well, say that the observed value
of the test statistica is n. Then you should sum the pdf over all k
such that pdf(k) <= pdf(n). This means summing over both tails.
And since the distribution is not symmetric,
you can not just sum over one tail and multiply by 2,
as you do with the 2sided ttest.
I don't see how to do that in a clean way using the current
statistical distributions API. (Am I missing something?)
Maybe some extension to the statistical distributions API is needed.
Something like cdf(symmetric(dist,x)) for the sum/integral of pdf(dist,y)
over all y such that pdf(dist,y) <= pdf(dist,x).
Johan Råde
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk