Hello everyone,
for model comparison, I calculated Bayes factors using the function “bayesfactor_models” from the bayestestR package. The models I ran with brms are ordinal models. When I calculated the Bayes factors, I got the factors, but also a warning of which I am not sure how bad it is, where it comes from and how to troubleshoot it. I paste the models further below. Maybe somebody has an idea.
I paste here the output of the model comparison for the model and the respective null model:
# Bayes Factors for Model Comparison
Model
[1] 1 + subject_shift * diagnosis + (1 + subject_shift | subj_uid) + (1 + subject_shift | item)
BF
17.17
* Against Denominator: [2] 1 + (1 | subj_uid) + (1 | item)
* Bayes Factor Type: marginal likelihoods (bridgesampling)
Warning message:
14 of the 32000 log_prob() evaluations on the proposal draws produced -Inf/Inf.
models:
model_subj_shift_brm_more_iterations = brm(answer ~ 1 + subject_shift * diagnosis + (1 + subject_shift|subj_uid) + (1 + subject_shift|item),
data = df_all_subjects %>% filter(type %in% c('c', 'd')),
family = cumulative('probit'),
warmup = 2000,
iter = 18000,
save_all_pars = TRUE,
set.seed(555),
control = list(adapt_delta = 0.9),
init_r = 0,
prior =
c(prior(normal(0, 2), class = Intercept),
prior(normal(0, 2), class = b),
prior(normal(0, 2), class = sd),
prior(lkj(1), class = cor)
)
)
model_subj_shift_brm_NULL = brm(answer ~ 1 + (1 |subj_uid) + (1 |item),
data = df_all_subjects %>% filter(type %in% c('c', 'd')),
family = cumulative('probit'),
warmup = 2000,
iter = 18000,
save_all_pars = TRUE,
set.seed(555),
init_r = 0,
control = list(adapt_delta = 0.9),
prior =
# the prior for the intercept, i.e. the mean rating
c(prior(normal(0, 2), class = Intercept),
# taus in our model
prior(normal(0, 2), class = sd)
)
)
ADMIN EDIT: Formatted code for clarity