Hi,
I’m fitting a model to generate prior predictive distributions, but they are not looking as expected. (I know that the priors are terrible, but that’s the whole point.)
library(dplyr)
library(brms)
df_spacebar_empty <- tibble(rt = runif(361, 0, 10000))
fit_prior_press <- brm(rt ~ 1,
data = df_spacebar_empty,
family = gaussian(),
prior = c(
prior(uniform(0, 60000), class = Intercept),
prior(uniform(0, 2000), class = sigma)
), chains = 1,
sample_prior = "only")
First of all I would expect the intercept to be 60000/2, but it’s 2604.49. (I got even smaller numbers when I set warmup =0
, which shouldn’t be a problem, or am I wrong?)
fit_prior_press
(...)
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 2604.49 1511.28 622.08 6442.92 1.53 2 11
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 997.40 559.00 51.91 1929.68 1.00 93 130
(...)
Warning messages:
... Ton of warnings here
I checked the prior predictive distributions, and I have the same problem:
posterior_predict(fit_prior_press) %>%
rowMeans() %>%
mean()
2606
Am I misunderstanding what brms is supposed to do? I’ve checked the stan code and it’s what I expect, but I’m not sure how brms is generating the predictive distribution.
- Operating System: Ubuntu 20.04
- brms Version: 2.13.5