The analyses using brms has slowed down, any hint?

Hi,
Till a few days ago I could run my analyses at a reasonable pace on my laptop. But, now the same analyses take more than a day and it finally gets terminated because of memory and timeout!
I took the analyses on the cluster server to come over the memory, but it is the same( too slow) and get killed.
When I run the syntax on my laptop and reach to compiling step it asks to re-install Rtools either with R 3.6.1 or R3.6.2.
This is my syntax:

if (!file.exists("barr.RData")) {
 
   bodi_fu1=read.csv("bodi_fu1.csv",check.names=TRUE)
  
  p<-get_prior( rec_n_r_bodn ~ mo(rec_comb_sevarrythmia)+age1,family=cumulative(),
                    data =bodi_fu1)
  
  p$prior[1] <- "normal(0,1)" # sets a N(0,1) on \beta
  p$prior[4] <- "normal(1.1,20)" # for each cutpoint
  p$prior[19] <- "dirichlet(2,2,2,2,2,2)" # sets weakly regularizing dirichlet for 1-3 Likert scale response
  
  fit_barr<-brm(
    formula = rec_n_r_bodn~ mo(rec_comb_sevarrythmia)+age1,family=cumulative(),
    data =bodi_fu1,prior=p, chains=5,control=list(adapt_delta=0.99),cores=future::availableCores())
  save(bodi_fu1, p, fit_barr, file="barr.RData")
} else {
  load("barr.Rdata")
}

Any hint is appreciated.
-Thanks

1 Like

Hi,
sorry to hear you are having problems. Could you be specific about the setup on your laptop and the cluster (OS, R version, RTools version, brms version)? Also, if you have a Makevars / Makevars.win file could you post its contents? (should be in HOME_DIRECTORY/.R/Makevars)

Also what did change in your setup in the meantime? Did you upgrade the OS/R/brms/… ?

Hope we can get that resolved quickly.

Hi,
I downloaded the recent brms on CRAN.
I use R3.6.1 on cluster but R3.6.2 on my laptop.
Rtools is 3.5 on my laptop but 3.4 on cluster
With the cluster I used below synatx and it improved the speed:
mv ~/R/3.6/library ~/R/3.6/library.old
mkdir ~/R/3.6/library

I do not have access to to the content of the makevar on cluster but on my laptop it is as below:

Thanks

## With Rcpp 0.11.0 and later, we no longer need to set PKG_LIBS as there is
## no user-facing library. The include path to headers is already set by R.
#PKG_LIBS =

## With R 3.1.0 or later, you can uncomment the following line to tell R to
## enable compilation with C++11 (or even C++14) where available
#CXX_STD = CXX11

So I assume both laptop and cluster are Linux? I can’t really help with Linux stuff, but hopefully @bbbales2 has an idea and is not busy?

The laptop is Rstudio on windows.

The issues with cluster/linux is resolved, though.
Thanks

1 Like

Sorry, I dropped the ball on this due to current events, did you manage to resolve this or do you still need help?

The RTools problem was discussed at RStan Always trying to download RTools when it's already installed (I also did have this problem on a machine, so you are by far the only one). Does the suggestion there resolve your issue?

Hi,
Yes, it seems it has been some other folks as well: RStudio do not find Rtools and offer to install even if already installed · Issue #3563 · rstudio/rstudio · GitHub
Rstudio not Stan. I used the advice from this website, to be honest, it has not been solved on my Laptop am still using cluster for my analyses, which is sometimes annoying as the server can be down sometimes :(

The hints here helped to resolve the issue! If anyone in the future come across this, the instruction is here!
https://cran.r-project.org/bin/windows/Rtools/

1 Like