jstat/jstat — Issue #36: poisson cdf returns values >1
Author: richarddmorey
Created: 2012-02-04 16:43:39+00:00
State: open

Similar issue to the binomial cdf, but this time there's no log(exp()) issue going on:

jStat(15,25,11).poisson(.725).cdf().toArray();
1,
1.0000000000000002,
1.0000000000000002,
1.0000000000000002,
1.0000000000000002,
1.0000000000000002,
1.0000000000000002,
1.0000000000000002,
1.0000000000000002,
1.0000000000000002,
1.0000000000000002

Since most of the discrete cdfs are going to be evaluated by summing, it would make sense to add a check:

if( sum >= 1) return 1;

That has the benefit of speeding up the code by not evaluating useless terms. But it might also have the downside of masking precision issues (like it would have with the binomial).