I am not sure if this is a good forum to file Posit Cloud bug reports (this post recommending people post issues here Where to report RStudio Cloud issues or suggestions? is kind of old) so please direct me to the correct place.
I have installed cmdstan on a Posit Cloud server and fit a model using the R package brms, with cmdstanr backend. Most everything works as expected except that when I run some brms code to add an information criterion to a fit model object, it causes the R session to hang. There is no indication of high RAM usage or CPU usage. The RAM usage ticker does not move at all. It stays this way until I manually terminate the execution. I tried increasing the maximum RAM and maximum CPUs but that does not solve the problem. I have tested identical code on a different remote Linux server and on my local Windows machine and not encountered any problems. Is this a known issue? I would appreciate any help with that. All code shown below executes correctly until hanging on the last line where it calls add_criterion()
. By the way I've successfully run add_criterion()
on other model objects, but only this specific one causes R to hang.
Reproducible example (hopefully someone can reproduce this behavior on Posit Cloud)
library(brms)
library(agridat)
options(mc.cores=4, brms.backend='cmdstanr')
data(diggle.cow)
diggle.cow$iron <- relevel(diggle.cow$iron, ref = 'NoIron')
diggle.cow$infect <- relevel(diggle.cow$infect, ref = 'NonInfected')
diggle.cow$dayafterstart <- diggle.cow$day - min(diggle.cow$day)
diggle.cow$weight_scaled <- scale(diggle.cow$weight)
diggle_compoundsymm <- brm(weight_scaled ~ iron * infect * dayafterstart + cosy(time = dayafterstart, gr = animal),
prior = c(
prior(normal(0, 5), class = b)
),
data = diggle.cow,
seed = 1002)
diggle_compoundsymm <- add_criterion(diggle_compoundsymm, 'loo')