Hello everyone,
I’ve been trying to fit the following brms model and the cor random effect doesn’t seem to converge.
What would be the appropriate solution? I attached the code, data and output of the model.
Thanks for the help!
rm(list=ls())
library(brms)
library(cmdstanr)
#get data
df=read.csv('./data/empirical_data/df.csv')
#formulas
formula_reveal = coherence ~ 0 + Intercept+reveal + (reveal|subject)
#set priors
Intercept_prior = set_prior(
prior = "normal(0,0.2)",
class = "b",
coef = "Intercept"
)
reveal_prior_weak = set_prior(
prior = "normal(0,0.4)",
class = "b",
coef = "reveal"
)
prior_reveal_weak=c(Intercept_prior,reveal_prior_weak)
#run reveal models
model_reveal_weak =
brm(
formula = formula_reveal,
data = df,
prior=prior_reveal_weak,
family = bernoulli(link = "logit"),
warmup = 1000,
iter = 2000,
chains = 4,
cores = 4,
seed = 123,
backend ="cmdstanr"
)
df.Rdata (1.8 MB)