-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
add moment for BART distribution #5211
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5211 +/- ##
==========================================
- Coverage 78.12% 77.98% -0.14%
==========================================
Files 88 88
Lines 14174 14227 +53
==========================================
+ Hits 11073 11095 +22
- Misses 3101 3132 +31
|
@@ -132,6 +137,13 @@ def logp(x, *inputs): | |||
""" | |||
return at.zeros_like(x) | |||
|
|||
@classmethod | |||
def get_moment(cls, rv, size, *rv_inputs): |
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.
Could BART shape be determined by the shape of the rv_inputs? Or does the mean already integrate this info?
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.
The shape of BART is always the shape of observed data Y.
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.
And do you do anything with the size variable or is that branch below unnecessary?
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.
everything is a lie :-) Initially I tough about having a size argument for future extension. But probably that will not be very useful.
pymc/bart/bart.py
Outdated
@classmethod | ||
def get_moment(cls, rv, size, *rv_inputs): | ||
mean = rv.Y.mean() | ||
if not rv_size_is_none(size): |
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.
Can you add a condition that hits this branch?
Following discussion in #5078