Slow and long time in running brm models

performance

#1

Hello
I’m trying to run a multilevel linear model using brms package, especially when including predictors in the fixed part and only one predictor in level 2.

R takes a long time to run the conditional model and mostly not responding

May you please help me how can I get faster simulation using this package

Moreover, I have another question regarding the interpretation of the results
for icc () function
I see the between-group variance and within group variance and after calculating the ICC manually it differs from R output
ICC: 0.25 HDI 89%: [0.06 0.42]
Between-group: 0.18 HDI 89%: [0.03 0.33]

Residuals

Within-group: 0.47 HDI 89%: [0.46 0.48]

I have calculated ICC as 0.18/(0.18+0.47)= 0.277, which differs from 0.25, I’m I calculated correctly

Thank you


#2

Can you please share more details: How slow is “slow?” Can you share your code, and describe the data you are using? How many iterations and chains did you run? Are you running your chains in parallel, by selecting options(mc.cores = parallel::detectCores())?


#3

Dear Kfeder
My code is
bayes<- brm(lnw ~ el + prep + sec + ad + ba + hd + ma + ph + age + age2 + sex + widowed + camp + ref + wp + gd + isd + const+ IMR + (1 + sex | OG), data=data, family=gaussian, prior=set_prior(“normal(0,100)”, class=“b”), control=list(adapt_delta=0.99, max_treedepth=15))

Note I used the default warmup, chains and iterations, and I’ve tried one time by choosing one chain (chains=1) but still not respond.

My data is information about income of individuals as well as some control variables.
the second level contains 7 groups only.

regarding your last question, I did not use it.

Awaiting your reply

Kind Regards


#4

For Slow
R takes about 20 minutes to compile the model, then chain 1 begin until 10%, then R becomes not responding even I have leave it for about 12 hours yesterday.


#5

I am not a brms expert, but try and set your prior to normal(0,1) instead of normal(0,100) and see if it speeds up - this could definitely be one reason that it is slow.

Broad uninformative priors like normal(0,100) are generally not recommended by the community since they are putting an unreasonable amount of mass on extreme values which is rarely a justified assumption.


#6

thank you
Could you explain to me how to choose the option of (mc.cores = parallel::detectCores())

thank you