Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add ZeroMeanNormal distribution and change GaussianEmission to use it. #44
Add ZeroMeanNormal distribution and change GaussianEmission to use it. #44
Changes from 5 commits
cabb0db
0180b5b
e4c785f
3b2003f
3192e6b
e20d77d
3a9490d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 these be renamed the same was as normal? Admittedly I don't love the single letter naming scheme or alpha and beta since I find these opaque, but would prefer the naming for both to be the same.
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.
They could, but I think the most important thing is that they match the math. Since https://www.cs.ubc.ca/~murphyk/Papers/bayesGauss.pdf and https://j-zin.github.io/files/Conjugate_Bayesian_analysis_of_common_distributions.pdf both use alpha and beta, I would strongly prefer that we keep those as the variable names.
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'd replace these tests with marginalization tests (see normal_test.cc to test against a boost computed logp and logp_score via approximate integration).
I find the testing exact value tests brittle and have the possibility of hiding bugs, and strongly prefer marginalization tests.
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 agree that marginalization tests are great. They are also a lot more work. My preference would be to have these minimal tests now, and then add the marginalization tests in a later pull request.
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 recommendation here is to copy the tests from normal_test.cc. I've added marginalization tests for logp and logp_score. Those should work the exact same here.
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.
hierarchical-irm/cxx/distributions/normal_test.cc
Line 36 in a03fa0b
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.
So I tried your recommendation and it didn't work. The latest commit of this pull request has the test_log_prob and it fails.
This shouldn't be surprising, because as previously noted, this distribution has different marginal likelihood and predictive posterior functions than the Normal. For example, when we do add a marginalization test for this distribution, it will only need to do a single integral over variances rather than the double integral done in normal_test.cc.