Hi,

I have tried to fit a generalized linear mixed model for predicting the probability of correctly identifying objects in images. This probability should depend on some fixed and random effects. Everything works fine until I include random effects on the displayed image. Once this random effect is included, the model predicts probabilities that are higher than the empirical means for the specific conditions. This is also seen when all other fixed and random effects are removed and only the influence of the image is examined:

```
final_data <- all_data %>%
select('original_img_name') %>%
mutate(original_img_name = factor(original_img_name))
model_formula <- brmsformula(correct_concept_detection ~ 1 + (1 | original_img_name),
family = bernoulli(link = 'logit'))
posterior <- brm(model_formula, data = final_data)
```

This code produces the following posterior:

```
Family: bernoulli
Links: mu = logit
Formula: correct_concept_detection ~ 1 + (1 | original_img_name)
Data: final_data (Number of observations: 7200)
Draws: 4 chains, each with iter = 3000; warmup = 1000; thin = 1;
total post-warmup draws = 8000
Group-Level Effects:
~original_img_name (Number of levels: 40)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.76 0.21 1.39 2.22 1.00 427 801
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.48 0.27 -0.06 0.99 1.01 274 438
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
```

The problem is that the intercept, which should represent the grand mean of the data, is too high. While 0.48 on the logit scale corresponds to a probability of 0.61, the empirical mean is 0.56. Furthermore, the differences in the random effects add up to -0.8 rather than zero. Another strange effect is that when I calculate predictions for each image (by adding the random effects to the intercept), those predictions are correct and correspond to the empirical means for each of the images. If I simplify the model even more and remove the random effect of image, the intercept is fitted correctly (about 0.24).

My question would therefore be why it is possible that the intercept term does not represent the grand mean of the data. Did I miss something obvious?

- brms Version: 2.19.0