-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support for computing log density of distributions #297
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #297 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 48 47 -1
Lines 5517 5521 +4
=========================================
+ Hits 5517 5521 +4
☔ 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.
Looked through this with Wes, Emma and Mantra.
We think the code looks good! But we're a little confused about when we would want to use the deterministic version. Couldn't find any docs in dust about this either but maybe I am not looking in the right place
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.
OK - looks good and I think I understand what this adds - check version before merging
I think this comment really goes with #296 ? The answer in any case is that this has proven a useful approximation as it runs way faster (but captures less of the dynamics). It's not yet clear exactly how the two relate to each other, and how you should move from one to another - some proper work needs doing on this at some point. The only docs are two lines here. I probably need to work with the science side to write up some good motivating examples, and that might be easier once they finish with a deterministic-vs-stochastic paper they're working on. |
Co-authored-by: M-Kusumgar <98405247+M-Kusumgar@users.noreply.github.com>
Agh yes it does! Thanks |
Merge after #296 as it contains those commits (see work plan in mrc-4182).
See mrc-4324...mrc-4326 for diff of just these changes
This PR computes the log density for some distributions (not many, and not exhaustive unlike #296 as this needs to mirror dust for now and there are a couple of interface issues to nail down later). It is intended to be enough to implement some proof-of-concept models more than anything actually very useful.
Note that there's a difference in how we hit this logic vs the expectations - with the expectations we analyse an expression and then every time we hit a r* function (e.g.,
rpois
) we replace the expression with a new one but most expressions pass through unchanged and we only alter things if they match our table of rules. Here, all compare expressions have the same type of call (compare(d) ~ poisson(lambda)
etc) which means that we don't do any analysis of the expressions we just start substituting directly.Note that this also exposes a bit of a pain that we write
which uses entirely different forms for the two calls. See mrc-4182 for more on that