Why is SD different for ranef() vs coef()?

#1

I just now discovered the coef() function (I had previously been just extracting ranef and adding to the fixed effect myself; d’oh!).

Anyway, I noticed that the SD for a given posterior RE is different than the SD for a given posterior FE+RE.
E.g.:

> coef(brmOut)$group[1,,'sigma_Intercept']
 Estimate Est.Error      Q2.5     Q97.5 
1.1603566 0.2947085 0.6521536 1.7991166 
> ranef(brmOut)$group[1,,'sigma_Intercept']
 Estimate Est.Error      Q2.5     Q97.5 
1.0538572 0.3109654 0.5027528 1.7131164 

This is counter-intuitive to me. Is there a reason why coef()'s Est.error is smaller than ranef()'s Est. error, given that the coef is just equal to the FE + RE?

Edit: Fixed effect for sigma_Intercept is .11, with post. SD of .11.

Edit 2: I just looked at my own implementation of it in Stan; it does the same thing. So this isn’t brms specific (sorry). A more general question then, is Why does b_{0i} = b_0 + u_{0i} have a smaller posterior SD than u_{0i}

0 Likes

#2

Never mind. I figured it out. That is very unintuitive to me.

The posterior samples for b0 and u_0i are correlated.
Cov(b0 + u_0i) = V(b0) + V(u_0i) + 2Cov(b0, u_0i); and the covariance is negative (correlation = -.33).

0 Likes