Skip to content
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

horseshoe prior #3

Open
bachlaw opened this issue Jan 4, 2017 · 7 comments
Open

horseshoe prior #3

bachlaw opened this issue Jan 4, 2017 · 7 comments

Comments

@bachlaw
Copy link

bachlaw commented Jan 4, 2017

As a possible feature, would it be possible to add a horseshoe prior option for the non-grouped variables? It is very useful in Stan but computationally time-consuming on large data sets. It may be much more effectively explored through an optimization approach. Ideally, this would be available through bayesglm as well to explore non-hierarchical versions of the same models.

@vdorie
Copy link
Owner

vdorie commented Jan 5, 2017

It should be possible, although as far as I can tell it would require a finite approximation since blme can't just sample the local shrinkage parameters as happens in Stan. In order to fit in the "mixed effects" framework, the global shrinkage parameter (tau) would be a hyperparameter - i.e. "fixed" and something passed in to the optimizer. Does that sound reasonable?

@bachlaw
Copy link
Author

bachlaw commented Jan 8, 2017

It certainly does. A finite approximation is certainly in the spirit of a MAP estimate and together these would allow users to screen out the options most likely to be unsuccessful before embarking on full Stan programming. Thank you!

@vdorie
Copy link
Owner

vdorie commented Jan 14, 2017

I've checked in an initial attempt. As far as I can tell, it is substantially shrinking fixed effects that are of a smaller order than the others but I'm not really experienced with the prior. It can be used by specifying

blmer(..., fixef.prior = horseshoe(mean = mu, global.shrinkage = tau, common.scale = TRUE))

@bachlaw
Copy link
Author

bachlaw commented Jan 14, 2017 via email

@bachlaw
Copy link
Author

bachlaw commented Jan 16, 2017

So, this works well with blmer but does not work for bglmer, at least with a standard binomial or poisson family. The error is:
Error in log(sapply(dist, expint::expint_E1, scale = TRUE)) : non-numeric argument to mathematical function

Is there a character class we need to account for? Sorry for all the trouble. Thanks much.

@bachlaw bachlaw closed this as completed Jan 16, 2017
@bachlaw bachlaw reopened this Jan 16, 2017
@vdorie
Copy link
Owner

vdorie commented Jan 16, 2017

Sorry about that, I wasn't thorough in my testing. It should be fixed now, and I've expanded the test suite in case I break it again in the future.

@bachlaw
Copy link
Author

bachlaw commented Jan 16, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants