After fitting the example in “brms: An R Package for Bayesian Generalized Linear Mixed Models using Stan”, I get that error and I don’t know how to fix it.
This is the model:
fit1 <- brm(formula = time | cens(censored) ~ age + sex + disease
+ (1 + age|patient),
data = kidney, family = c(“gaussian”, “log”),
prior = c(set_prior(“normal(0,10)”, class = “b”),
set_prior(“cauchy(0,2)”, class = “sd”),
set_prior(“lkj(2)”, class = “cor”)),
n.warmup = 500, n.iter = 2000, n.chains = 2)
I copied it from the paper like that. After doing what you suggest, I found that the actual arguments are warmup, tier and chains (without the n). But then this happened:
Chain 1: Initialization between (-2, 2) failed after 100 attempts.
Chain 1: Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
[1] “Error in sampler$call_sampler(args_list[[i]]) : Initialization failed.”
error occurred during calling the sampler; sampling not done
Is that paper too old for the new version, or what is happening? I’m trying to learn how to use brms following that paper.