Short summary of the problem
I am trying to fit some fairly standard logistic regression models using BRMS on a cluster, but in almost all cases (aside from one very simple model which I will paste below), the fitting seems to fail with little to no indication as to why. The primary model I am trying to run is:
priors <- prior(horseshoe(1), nlpar="a")
model_occ <- bf(
outcome ~ a + splines, nl=TRUE
) + lf(
a ~ sex + isdiabetes_clean + respiratory_and_asthma_clean +
chronicheart_clean + chronicrenal_clean + chronicneurological_clean +
immunosuppressiondisease_clean + hypertension_clean +
CriticalCareOcc + (1|ethnicity6) + (1|obese) + week_hosp + chronicliver_clean
) + lf(
splines ~ 0 + s(ageyear, k=4, bs="cr")
)
fit_occ <- brm(model_occ,
data = df_primary_hdu[1:100,],
prior = priors,
family = brms::bernoulli(link = "logit"),
control = list(adapt_delta = 0.95),
iter=4000,
knots = list(
ageyear = as.vector(quantile(df_primary_hdu$ageyear, probs=c(0.05, 0.35, 0.65, 0.95)))
),
chains=5,
cores=5,
seed = 12345,
backend="cmdstanr"
)
But I always get the following errors / warnings:
Compiling Stan program...
Start sampling
Running MCMC with 5 parallel chains...
Warning: Chain 1 finished unexpectedly!
Warning: Chain 2 finished unexpectedly!
Warning: Chain 3 finished unexpectedly!
Warning: Chain 4 finished unexpectedly!
Warning: Chain 5 finished unexpectedly!
Warning: Use read_cmdstan_csv() to read the results of the failed chains.
Error in rstan::read_stan_csv(out$output_files()) :
csvfiles does not contain any CSV file name
In addition: Warning messages:
1: All chains finished unexpectedly!
2: No chains finished successfully. Unable to retrieve the fit.
A more simple model such as the following works fine though:
priors <- prior(horseshoe(1))
model_occ_min <- bf(
outcome ~ CriticalCareOcc
)
fit_occ_min <- brm(
model_occ_min,
data = df_primary,
prior = priors,
family = brms::bernoulli(link = "logit"),
control = list(adapt_delta = 0.95),
iter=4000,
chains=4,
cores=4,
seed = 12345,
backend="cmdstanr"
)
These models work fine on Mac OS with the same data, so not sure why they would fail here. An example model such as that from a vignette I found here also works Estimating Monotonic Effects with brms • brms which leads me to be confused as to what the problem might be, open to any suggestions of things to try to try and narrow this problem down. Thank you.
If possible, add also code to simulate data or attach a (subset of) the dataset you work with.
Unfortunately I cannot as it is sensitive data, hence why I am working on a remote cluster
Please also provide the following information in addition to your question:
- Operating System: Red Hat Enterprise Linux 7.8
- brms Version: brms_2.14.4