Created
September 19, 2018 13:41
-
-
Save benwhalley/058cd2588239eb5acb5b1b0247ad281c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(brms) | |
library(tidyverse) | |
m1 <- rstanarm::stan_glm(mpg~wt, data=mtcars) | |
prior_summary(m1) | |
# see what priors brms will let you set | |
get_prior(mpg~wt, data=mtcars) | |
# then then mimic beta priors from rstanarm (inc rstanarm autoscaling) | |
m2 <- brm(mpg~wt, data=mtcars, sample_prior="only", | |
prior = c(prior_string("normal(0,15.4)", class="b"), | |
prior = prior_string("normal(0,60.27)", class="Intercept" ))) | |
samps <- tidybayes::add_fitted_samples(tibble(wt=1:2), m2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment