-
Notifications
You must be signed in to change notification settings - Fork 4
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
Correct Formula For Poisson Log-Likelihood #420
Conversation
Per this comment #375 (comment) corrected the formula for the poisson log-likelihood, including swapping the `ymodel` and `ydata` so it matches prior poisson likelihood. Added a unit test case to demonstrate this change is to restore current behavior.
dd91111
to
8e5baa3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand what the test does, but the formula is correct, thanks
not sure if it possible or interesting to test against scipy poison pmf. |
We could remove this restriction for the poisson log-likelihood with the formulaic approach: flepiMoP/flepimop/gempyor_pkg/src/gempyor/statistics.py Lines 279 to 281 in 8e5baa3
Might be better for the next release since it is a behavior change. |
The test fails without the formula change so if a case had been written earlier we would have caught this behavior change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Timothy! How does the current implementation behave when either ymodel or ydata are zero? I'm used to adding one to both ymodel and ydata because this should not change the location of the maximum probability, and only alter the confidence range minimally.
see #375 (comment) @twallema , this just added one to the model output but not the data. |
The changes can be summarized as:
|
Added a test case with poisson log-likelihood and zero valued data with the `zero_to_one` flag set to `True`.
8bf65b4
to
10e5d98
Compare
Interesting Timothy! What behaviour is preferred? |
@jcblemai Sorry, I accidentally removed the whole comment below, instead of my reply. @TimothyWillard so in the ymodel=0 and ydata=0 case we would now get an error? |
I think a NaN llik is not an error but a rejection of the proposal |
Emcee throws an “likelihood function returned Nan error” which stops the operation in this case, I had this happen before. |
|
Describe your changes.
Per this comment #375 (comment) corrected the formula for the poisson log-likelihood, including swapping the
ymodel
andydata
so it matches prior poisson likelihood. Added a unit test case to demonstrate this change is to restore current behavior.Does this pull request make any user interface changes? If so please describe.
This change does not present any user interface changes, but instead fixes behavior in the
dev
branch.