Let . After integrating out the random intercepts,
The fixed-effect design matrix has four independent columns, so the given has dimensions , with and . Consequently the error contrasts have a multivariate normal distribution with mean zero and covariance matrix .
The restricted likelihood from orthogonal error contrasts is their density. Equivalently, the estimates maximize
This is restricted maximum likelihood, not maximization over individual rat effects. The unknown disappears because . Replacing by for an orthogonal rotates and conjugates , preserving the determinant and quadratic form; hence the objective is independent of the chosen orthonormal basis. The software's integrated REML log-likelihood can differ by an additive constant depending only on , which has no effect on these variance estimates.