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 28, 2019
1 parent 203b8e3 commit e5d8c2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/distributions/binomial.rs
Expand Up @@ -257,7 +257,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 e5d8c2c

Please sign in to comment.