Hello,
I’m calculating Bayes Factors for a brms
model using bayesfactor_parameters()
and I get wildly different results when manually setting a normal distribution, versus when I allow the function to calculate it’s own priors from the model. By what I can tell from the documentation, it is doing this by using the unupdate()
function on the model posteriors.
I manually set priors to my model before running (see below). My question is, should I allow the bayesfactor_parametrs()
function to do it’s thing on it’s own, or should I set priors again manually, either with a normal distribution or with my previous priors from the model?
This is for a basic, one predictor mixed effects model.
Formula: DV ~ IV + (1 + IV || participant)
Here are my model and priors
# set priors
fcP <- c(prior(normal(0,1), class='Intercept'), prior(normal(0,1), class='b'),
prior(gamma(1,1), class='sd'), prior(gamma(1,1), class='phi'))
# make model
fcM <- brm(fcF, family=Beta('logit'), data=beta_p_play_means, fcP,
chains=8, cores=8, init=0, control=list(adapt_delta=.99),
threads=threading(2), backend='cmdstanr', normalize=F)
When I use bayesfactor_parameters(fcM)
I get a BF of 0.15
But when I extract the psoteriors myself and use a normal distribution prior (note: “slope” is the name of the IV):
fcposterior <- posterior_samples(fcM)
as.numeric(bayesfactor_parameters(fcposterior$b_slope, prior=distribution_normal(8000,0,1)))
I get a BF of 3.47
I know BFs are sensitive to priors but this difference is enormous.
I tried passing my fcP
prior df to bayesfactor_parameters()
but it won’t accept it as it tries to use unupdate()
whenever it detects a brmsfit object.
I am leaning towards feeling that there is no “significant” effect here and so am more inclined to trust bayesfactor_parameters(fcM)
without manually specifying priors. But am still a bit confused by the massive difference. I have a similar model with a different predictor (but same priors) and the Bayes Factors from the two methods above are much more (reassuringly) similar.
Hope the info I provided is detailed enough and appreciate any thoughts! 🙂