## The GLMM definition

As in the GLM, ^ is the vector of expected means of the observations and is linked to the model parameters by a link function, g:

X and Z are the fixed and random effects design matrices, and a and p are the vectors of fixed and random effects parameters as in the normal mixed model. The random effects, p, can again be assumed to follow a normal distribution:

and G is defined just as in Section 2.2. The variance matrix can be written var(y) = V = var(^) + R, where R is the residual variance matrix, var(e). However, V is not as easily specified as it was for normal data where V = ZGZ' + R. This is because ^ is not now a linear function of p. A first-order approximation used by some fitting methods is

V « BZGZ B + R, where B is a diagonal matrix of variances determined by the underlying distribution as described in Section 3.1 (e.g. B = diag{^;(1 — fii)j for binary data). In random effects and random coefficients models the residual matrix, R, is diagonal since the residuals are assumed uncorrelated. The diagonal variance terms are equal to the expected variances given the underlying distribution, and thus

R = AB as in the GLMs. For random effects and random coefficients models, V can then be written

In covariance pattern models, correlated residuals are allowed and R can be expressed as a product of a correlation matrix defined on the linear scale, P, and AB: