This project has moved and is read-only. For the latest updates, please go here.

Binomial distribution not working correctly

Mar 10, 2014 at 10:07 AM
When I try the following:
var binomial = new Binomial(0.0638, 3779);

binomial.CumulativeDistribution(250);
It will return Infinity

But when I try it in excel with =BINOM.DIST(250, 3779; 0.0638, TRUE) I will get 0.736156366002849

I've tried to write my own implementation, but I get the same result.

Only library I've found where this will work is Extreme Optimization
Mar 10, 2014 at 11:00 AM
Indeed, the current binomial CDF implementation could be better. In the meantime you can get the same result by using the special functions directly:
SpecialFunctions.BetaRegularized(3779-250,250+1,1.0-0.0638) -> 0.736156366003278
Marked as answer by cdrnet on 3/10/2014 at 3:17 AM
Mar 10, 2014 at 11:16 AM
Update: fixed in mainline master, so using the binomial distribution as above should work properly in the next release.

Thanks,
Christoph