Skip to content

Commit

Permalink
Binomial: Use correct sign for stirling correction
Browse files Browse the repository at this point in the history
This was noted by the GSL implementors. The new signs were confirmed by
one of the authors publishing the original algorithm.
  • Loading branch information
vks committed Feb 21, 2019
1 parent 833cfe6 commit bf96f64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/distributions/binomial.rs
Expand Up @@ -234,7 +234,7 @@ impl Distribution<u64> for Binomial {
if alpha > x_m * (f1 / x1).ln()
+ (n - (m as f64) + 0.5) * (z / w).ln()
+ ((y - m) as f64) * (w * p / (x1 * q)).ln()
+ stirling(f1) + stirling(z) + stirling(x1) + stirling(w)
+ stirling(f1) + stirling(z) - stirling(x1) - stirling(w)
{
continue;
}
Expand Down

0 comments on commit bf96f64

Please sign in to comment.