Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for scipy issue 17146 #847

Merged
merged 2 commits into from
Oct 18, 2022
Merged

Fix for scipy issue 17146 #847

merged 2 commits into from
Oct 18, 2022

Conversation

mborland
Copy link
Member

@mborland mborland merged commit 53534c5 into boostorg:develop Oct 18, 2022
@mborland mborland deleted the binom_pmf branch October 18, 2022 00:54
if (k == 0)
{ // binomial coeffic (n 0) = 1,
// n ^ 0 = 1
return pow(1 - dist.success_fraction(), n);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on Matt, and with apologies for being AWOL: I'm just catching up with everything while writing the release notes for 1.81.

Since ibeta_derivative is relatively heavyweight, and the alternative formula is so simple, I think it would be nice to have retained the alternative form here. The trick would be to take logs and use exp(n*log1p(-dist.success_fraction())) in the case where - dist.success_fraction() is small. Maybe try 0.125 as a cutoff? Might need some experimenting to see where the errors start to rise.

This can certainly wait till after the next release though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants