Hi, I’m new to bayesian modelling and brms
so maybe my question is trivial. However, I’m fitting a multinomial regression using brms
. The response variable response
is modeled as a function of a binary factor GROUP
and then a random intercept for subjects 1|ID
. This is my model:
fit <- brm(response ~ GROUP + (1|ID),
cores = n_cores,
family = categorical(link = "logit"),
data = data_exp1,
chains = 6,
iter = 4000,
warmup = 2000,
control = list(adapt_delta = 0.999,
max_treedepth = 15))
The control
parameters were set according to some warnings about the model (following this https://mc-stan.org/misc/warnings).
This model works fine but the compilation time is very long (30 minutes) so I’ve read about putting slightly informative priors according to my parameters.
This is the prior summary (with default priors):
prior_summary(fit)
prior class coef group resp dpar nlpar bound
1 b mudisgust
2 b GROUPIMS mudisgust
3 b mufear
4 b GROUPIMS mufear
5 b musadness
6 b GROUPIMS musadness
7 b musurprise
8 b GROUPIMS musurprise
9 student_t(3, 0, 10) Intercept mudisgust
10 student_t(3, 0, 10) Intercept mufear
11 student_t(3, 0, 10) Intercept musadness
12 student_t(3, 0, 10) Intercept musurprise
13 student_t(3, 0, 10) sd mudisgust
14 student_t(3, 0, 10) sd mufear
15 student_t(3, 0, 10) sd musadness
16 student_t(3, 0, 10) sd musurprise
17 sd ID mudisgust
18 sd Intercept ID mudisgust
19 sd ID mufear
20 sd Intercept ID mufear
21 sd ID musadness
22 sd Intercept ID musadness
23 sd ID musurprise
24 sd Intercept ID musurprise
Given that my fixed effects are all odds ratio in log scale a reasonable prior might be a normal distribution with mean = 0
and a broad SD
.
fixef(fit)
Estimate Est.Error Q2.5 Q97.5
mudisgust_Intercept 1.3054715 0.4063684 0.5105506 2.1279143
mufear_Intercept 2.7147141 0.3380190 2.0931628 3.4193736
musadness_Intercept 0.6062926 0.4717226 -0.3891898 1.5063598
musurprise_Intercept 1.0915517 0.4007677 0.2983177 1.8751994
mudisgust_GROUPIMS 0.2545814 0.6390059 -0.9781262 1.5333117
mufear_GROUPIMS -0.6974617 0.5408466 -1.7542061 0.3734919
musadness_GROUPIMS -1.2186215 0.8067931 -2.8796989 0.3203030
musurprise_GROUPIMS -0.4853391 0.6435296 -1.7527883 0.7877122
I’ve set my priors but a warning message appears during the fitting about the deprecated usage of a global priors on all beta parameters and this could bring to unexpected results.
mod_prior = c(prior_string("normal(0, 10)", class = "b"),
prior_string("normal(0, 10)", class = "Intercept"))
Given that I would like to simply speed my fitting time what could I do?