I am currently working on generalized linear mixed models (GLMM) and need some help concerning the prediction of the random effects. More specifically, I don't understand the given representation of the conditional expectation of the random effect, i.e.
$$ \mathbb{E}[X | Y] = \int f\_{X|Y} (x|y)\: dx = \int \frac{f\_{Y|X}(y|x)f\_{X}(x)}{\int f\_{Y|X}(y|x)f\_{X}(x)dx} dx$$(the second equation being the one I don't understand)


This is the representation in general. In a one way classification, $X$ would be the random effect, $Y$ the response group (vector) for the random effect.  

Found in several papers and books of McCulloch et al.



Conditional density for random effects prediction in GLMM
This has nothing to do with GLMM's per se. All what is done here is using the definition 
$$f\_{Y|X}(y|x):=\frac{f\_{X,Y}(x,y)}{f\_X(x)}$$
(if $f\_X(x)\ne0$) to write 
$$f\_{Y|X}(y|x)f\_X(x)=f\_{X,Y}(x,y),$$
so that  

$$\int f\_{Y|X}(y|x)f\_X(x)\,dx=\int f\_{X,Y}(x,y)\,dx=f\_Y(y)$$
and hence 
$$\frac{f\_{Y|X}(y|x)f\_{X}(x)}{\int f\_{Y|X}(y|x)f\_{X}(x)\,dx}
=\frac{f\_{X,Y}(x,y)}{f\_Y(y)}
=f\_{X|Y} (x|y).$$


