-
Notifications
You must be signed in to change notification settings - Fork 47
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
Relative: fix log of zero for default 0 sigma values #1377
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #1377 +/- ##
============================================
- Coverage 84.41% 53.72% -30.69%
============================================
Files 157 157
Lines 12919 12928 +9
============================================
- Hits 10905 6946 -3959
- Misses 2014 5982 +3968 ☔ View full report in Codecov by Sentry. |
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.
LGTM, thank you!
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.
👍 thx
If an observable has hierarchical noise, but has no measurement at some simulation timepoint for which the model is simulated, then the
edata.getObservedData
will benan
but therdata.sigmay
for that condition, observable and timepoint will be 0.This was causing an issue in the direct calculation of the NLLH as we were taking the
log(2 * np.pi * sigma_i**2)
wheresigma_i
wasrdata.sigmay
. This gaveRuntimeWarning: divide by zero encountered in log
errors.The fix is simple: mask the
sigma_i
array with the mask for which the data is notnan
. Already available inproblem.data_mask
.Was raised in issue #1375