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 nplog1p in poisson/negbinom likelihood function #86

Merged
merged 5 commits into from
Sep 6, 2024

Conversation

twallema
Copy link
Owner

@twallema twallema commented Sep 6, 2024

  • I have checked to ensure there aren't other open Pull Requests for the same update/change
  • I have updated the documentation accordingly.

Describe your fixes/additions/changes

In ll_poisson and ll_negative_binomial, there was a test to see if the ydata or ymodel were smaller than or equal to one. If this was the case, then the minimal model/data point were found and raised to 1e-6. This is,

  1. Unnecessarily complex, you can just add one to both ymodel and ydata.
  2. May actually introduce bias, because a log of a small number tends to negative infinity.

So now, by default, in ll_poisson and ll_negative_binomial,

ymodel += 1
data += 1

I've verified this gives the same results in the workflow & influenza 17-18 tutorial.

@twallema twallema merged commit bb38bd6 into master Sep 6, 2024
2 checks passed
@twallema twallema deleted the use-nplog1p-in-poisson-likelihood-function branch September 6, 2024 17:09
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.

1 participant