Dear all, I noticed a considerable discrepancy between nominal priors (intended priors, theoretical or generated with RNG) and the actually sampled priors. I understand how both methods can differ numerically, but what I observe seems excessive. Perhaps I am misunderstanding something.
The following MRE illustrates the issue well, I hope:
library(brms, quietly = TRUE) #> Loading 'brms' package (version 2.13.0). Useful instructions #> can be found by typing help('brms'). A more detailed introduction #> to the package is available through vignette('brms_overview'). #> #> Attaching package: 'brms' #> The following object is masked from 'package:stats': #> #> ar library(tidyverse, quietly = TRUE) dummy_dat <- with( list(N = 5e3), data.frame( mu = 1, x = gl(2, N/2), y = 0 # irrelevant, but necessary ) ) pred_priors <- brm(y ~ 1 + x, sample_prior = "only", prior = c( set_prior("student_t(3, 0, 2.5)", class = "Intercept"), set_prior("skew_normal(-1, 1, -4)", class = "b") ), data = dummy_dat, iter = 5e3, refresh = FALSE ) #> Compiling the C++ model #> Start sampling pred_priors %>% posterior_samples(pars = "b_") %>% add_column( nominal_int = rstudent_t(nrow(.), 3, 0, 2.5), nominal_x = rskew_normal(nrow(.), -1, 1, -4) ) %>% gather(sample, value) %>% ggplot(aes(value, colour = sample)) + geom_vline(xintercept = 0, colour = "grey80") + geom_density() + scale_x_continuous(limits = c(-10, 10)) #> Warning: Removed 556 rows containing non-finite values (stat_density).
Created on 2020-06-22 by the reprex package (v0.3.0)
I expect the curves would match more closely. In particular, for the Skew-Normal prior, I expected to get some probability above 0 but the support of the realised prior is entirely below 0. This raises the question of which prior I am really using: the one that I specified or the one that has been realised (I guess the latter?).
Thanks in advance for your insights.