- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 11
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 a Gibbs sampler for the Horseshoe prior and a Polya-gamma normal scale-mixture expansion #1
Conversation
ae0afc9
to
e1bdbac
Compare
5d6d049
to
7f27650
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.
Looks great!
I just added a few comments about general refactoring. If you don't mind rebasing, I can make those changes to this branch.
Otherwise, we need to get the coverage working on this repo so we can make sure that checks out, and we can continue to iterate on MCMC/model-level testing. We could also just merge this after coverage checks out and iterate in follow-ups.
155f034
to
72cb9c6
Compare
Codecov Report
@@ Coverage Diff @@
## main #1 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 2
Lines ? 99
Branches ? 6
========================================
Hits ? 99
Misses ? 0
Partials ? 0 Continue to review full report at Codecov.
|
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, I pushed those refactoring changes. Now, we should try to do one other: separate the Horseshoe and Polya-gamma sampler steps.
In other words, we could have helper functions that generate sampler steps for each independently, then we can provide one that combines the two. This allows people to generate Polya-gamma scale-mixture samplers and normal Horseshoe samplers independently. Plus, it will serve as the basis for us to automate the creation of Horseshoe samplers for a wide variety of known scale mixtures.
Also, we need to set up some tests specifically for the PolyaGammaRV
in a test_dists.py
. Those tests can be really simple, though, because the implementation is just a pass-through to polyagamma
. For that matter, it could be just a single test.
da6a5aa
to
9c0b301
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.
This is looking great. I added some minor comments, but, aside from those, we can merge this after squashing.
752e701
to
0e7382e
Compare
@brandonwillard i've squashed the commits and addressed the comments made. |
…scale-mixture expansion
0e7382e
to
0f5e947
Compare
This PR adds functions for creating sampler steps for a normal regression under a Horseshoe prior as described in "A Simple Sampler for the Horseshoe Estimator" (Makalic, Enes & Schmidt, Daniel, 2015).
It also implements the Polya-gamma normal scale mixture expansion described in "Data Augmentation for Non-Gaussian Regression Models Using Variance-Mean Mixtures" (Polson, Nicholas G., and James G. Scott, 2013) and the multivariate normal sampler in "Fast Simulation of Hyperplane-Truncated Multivariate Normal Distributions" (Cong, Yulai, Bo Chen, and Mingyuan Zhou, 2017).