Hi, I’m trying to fit some firing rate data with a brms
model. I model the firing rates from the predictors using a negative binomial regression with random intercepts for cell. The model seem to fit mostly fine, within a reasonable time and no divergent transitions, however, I do get warnings about low bulk and tail effective sample size (ESS). Specifically, I’m getting very low ESS for the global intercept and the sd of the random intercepts (the other parameters are fine).
I’ve looked at pairs plots in shinystan and there doesn’t seem to be strong correlation between any pair of the parameters. However, the two troublesome parameters (Intercept and sd of random intercepts) do have high autocorrelation.
I tried fiddling around with the brm()
controls and setting somewhat more informative priors, however, that didn’t really help. The only thing I found that helps is setting the priors for Intercept and sd of intercepts very narrow, centered on the previously estimated posterior means (see the model code below). After that, the model samples well and I get good ESS for all parameters.
Code for the model with the very strong priors that results in good ESS:
fit1 <- brm( FR ~ 1 + Cat + CorInc + (1 | Cell), data = df, family = negbinomial(),
#control = list(adapt_delta = 0.9, max_treedepth = 10),
prior = c(prior(normal(-1.24, 0.01), class = 'Intercept'),
prior(normal(1.32, 0.01), class = 'sd', coef = 'Intercept', group = 'Cell')),
iter = 1000, chains = 4, cores = 4)
Any idea of what could be the problem and how to fix it? Thanks!