Hi folks,
I have the following multiresponse phylogenetic mixed model in brms :
model <- brms::brm(brms::brmsformula(mvbind(t1, t2, t3) ~ state + (1|p|gr(binominal, cov = corrmat)) + (1|q|taxa)) + set_rescor(TRUE), data = fred4, data2 = list(corrmat = corrmat), chains = 4, cores = 4, threads = 6, iter = 10000)
The issue with this is that after 2 days and 15 hours, it hasn’t even progressed past the 1st iteration. Pasting the output below:
SAMPLING FOR MODEL 'anon_model' NOW (CHAIN 1).
SAMPLING FOR MODEL 'anon_model' NOW (CHAIN 2).
SAMPLINGSAMPLING FOR MODEL ' FOR MODEL 'anon_modelanon_model' NOW (CHAIN ' NOW (CHAIN 34).
).
Chain 3:
Chain 3: Gradient evaluation took 1.26292 seconds
Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 12629.2 seconds.
Chain 3: Adjust your expectations accordingly!
Chain 3:
Chain 3:
Chain 1:
Chain 1: Gradient evaluation took 1.61108 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 16110.8 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 2:
Chain 2: Gradient evaluation took 1.47388 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 14738.8 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Chain 4:
Chain 4: Gradient evaluation took 1.78846 seconds
Chain 4: 1000 transitions using 10 leapfrog steps per transition would take 17884.6 seconds.
Chain 4: Adjust your expectations accordingly!
Chain 4:
Chain 4:
Chain 3: Iteration: 1 / 10000 [ 0%] (Warmup)
Chain 4: Iteration: 1 / 10000 [ 0%] (Warmup)
Chain 2: Iteration: 1 / 10000 [ 0%] (Warmup)
Chain 1: Iteration: 1 / 10000 [ 0%] (Warmup)
I don’t believe this model is that complex to be taking this much time? Is it?
- My phylogeny has 1301 plant species
t1,t2andt3are logged and standardized continuous traitsstateis a categorical trait with 6 different characterstaxaandbinominalare identical columns specifying the species names
The following model finished within 43 hours on the same machine:
brms::brm(brms::brmsformula(mvbind(t1, t2, t3) ~ state + (1|gr(binominal, cov = corrmat)) + (1|taxa)) + set_rescor(TRUE), data = fred4, data2 = list(corrmat = corrmat), chains = 4, cores = 4, threads = 6, iter = 10000)
The only difference between the slow one and this one is that the slow one treats the random effects as correlated ((1|p|gr(binominal, cov = corrmat)), ((1|q|taxa)) whereas the other one did not. Is this enough to make the runtime this long? Is this to be expected? Or is there anything I’m doing wrong? Is there a way to speed up the execution (setting priors, using more cores, more chains…?)?
These models were run on an Ubuntu 24.04.4 LTS VM with 32 vCPUs and 128 GBs of RAM. Installed R version is 4.6.1 and brms version is 2.23.0.
I’d appreciate any help with this. Also please feel free to ask if more info is needed. Thanks!