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

Use scipy stats for PoissonLL #40

Merged
merged 2 commits into from
Oct 5, 2023
Merged

Conversation

hammannr
Copy link
Collaborator

@hammannr hammannr commented Oct 5, 2023

I'm running into an edge case for the binned likelihood, where np.log(expected_total) throws an error when any of the expectations are zero. However, this is not problematic as long as the number of observed events in the same bins is zero. So instead of -inf or nan it makes sense to return 0 in this case.
Scipy stats has implemented this case accordingly, so I propose switching to this implementation.

@kdund kdund self-requested a review October 5, 2023 15:09
Copy link
Collaborator

@kdund kdund left a comment

Choose a reason for hiding this comment

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

Thanks, @hammannr i agree with covering this edgecase

@kdund kdund merged commit 8c13e65 into JelleAalbers:master Oct 5, 2023
1 check passed
@hammannr hammannr deleted the poisson_0_0 branch October 5, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants