Why whiten correlated random effects?
A Gaussian random-effects vector can have components that vary together. Numerical integration is often more convenient when the integration variables are independent standard normals, because standard-normal quadrature rules can then be used directly. Cholesky whitening makes this change of coordinates without changing the integral being evaluated. It changes the coordinates, not the statistical model or the dimension of the integral.
Suppose \(y\) denotes the observed responses, \(b\) is a \(q\)-dimensional Gaussian random-effects vector, and \(\beta\) denotes fixed-effect parameters. Conditional on \(b\), the responses follow the specified GLMM response model. The random effects have mean zero and covariance matrix \(\Sigma\). The marginal likelihood contribution is obtained by integrating the conditional likelihood over the distribution of \(b\). The discussion below concerns how to transform that integral when \(\Sigma\) is correlated.
Positive definiteness matters: it guarantees an ordinary nonsingular Cholesky factor and an invertible change of variables. A zero-mean Gaussian vector with a positive-definite covariance has density \( \phi_q(b;0,\Sigma)=(2\pi)^{-q/2}|\Sigma|^{-1/2}\exp\{-b^\mathsf{T}\Sigma^{-1}b/2\} \). The factor \(L\) is not generally diagonal. Consequently, \(b=Lz\) mixes the independent coordinates of \(z\) to produce the intended covariance among the components of \(b\).
How the change of coordinates preserves the integral
Write \(g(b)=p(y\mid b;\beta)\) for the conditional likelihood at a given random-effects vector. For fixed model parameters, the marginal likelihood contribution is \( \int_{\mathbb R^q}g(b)\phi_q(b;0,\Sigma)\,db \). Under \(b=Lz\), the Jacobian determinant is \(|\det L|\), and \(\Sigma^{-1}=L^{-\mathsf{T}}L^{-1}\). These identities give the transformed integral exactly.
For the cancellation in the second line, \(|\Sigma|=|LL^\mathsf{T}|=(\det L)^2\). Since the diagonal entries of \(L\) are positive, \(|\det L|=\det L=|\Sigma|^{1/2}\). The factor from the change-of-variables Jacobian therefore cancels the covariance determinant in the Gaussian density. The exponent becomes \(z^\mathsf{T}z\), since \(b^\mathsf{T}\Sigma^{-1}b=z^\mathsf{T}z\). These steps establish that the transformed variables are independent standard normals and that no extra determinant multiplier remains in the expectation.
The equality is exact; numerical quadrature is used only to approximate the resulting expectation. In a GLMM, the integrand evaluated at a quadrature point \(z\) is the conditional likelihood at \(b=Lz\). If the covariance depends on model parameters, its Cholesky factor must be calculated from the current covariance matrix when that matrix changes.
Worked Example: Factorizing a Correlated Covariance Matrix
Suppose a two-dimensional random-effects vector has covariance \( \Sigma=\begin{pmatrix}4&1.2\\1.2&1\end{pmatrix} \). Find its Cholesky factor and transform the standard-normal point \(z=(0.5,-1)^\mathsf{T}\) into random-effects coordinates.
Try \(L=\begin{pmatrix}2&0\\0.6&0.8\end{pmatrix}\), which is lower triangular with positive diagonal entries. Verify the factorization rather than relying on the proposed entries:
Thus this is the Cholesky factor. Applying \(b=Lz\) gives \( b_1=2(0.5)+0(-1)=1 \) and \( b_2=0.6(0.5)+0.8(-1)=0.3-0.8=-0.5 \). So the corresponding random-effects point is \(b=(1,-0.5)^\mathsf{T}\). To check the inverse transformation, solve \(Lz=b\): \(z_1=1/2=0.5\) and \(z_2=(-0.5-0.6(0.5))/0.8=-1\), recovering the original point.
Using the whitened coordinates for quadrature
Once the integral is written as \(\mathbb E\{g(LZ)\}\), quadrature points are generated in standard-normal coordinates. For each point, first compute \(b=Lz\); then evaluate the conditional likelihood using that \(b\). The Gaussian density weighting is already represented by the standard-normal quadrature weights. Multiplying by the original correlated density again, or adding a further determinant factor, would count the density incorrectly.
The following example uses a two-point standard-normal quadrature rule with nodes \(-1\) and \(1\), each with weight \(1/2\). Its two-dimensional product rule has four points, each with weight \(1/4\). This is a deliberately small illustrative rule; it shows the coordinate transformation and arithmetic, not a guarantee of high accuracy.
Worked Example: A Two-Dimensional Quadrature Calculation
Consider one hypothetical binary response with observed value \(y=1\). Let its conditional success probability be \(P(Y=1\mid b)=\operatorname{logit}^{-1}(0.5+b_1+b_2)\), where \(\operatorname{logit}^{-1}(u)=1/(1+\exp(-u))\). Suppose \(b\sim N_2(0,\Sigma)\) with \(L=\begin{pmatrix}3&0\\0.4&2\end{pmatrix}\), so \(\Sigma=LL^\mathsf{T}=\begin{pmatrix}9&1.2\\1.2&4.16\end{pmatrix}\). For example, its lower-right entry is \(0.4^2+2^2=4.16\).
At the four product-rule nodes, calculate \(b=Lz\) and then the linear predictor \(\eta=0.5+b_1+b_2\):
For \(y=1\), the conditional likelihood at each point is \(\operatorname{logit}^{-1}(\eta)\). The quadrature estimate of the marginal probability of the observed response is therefore
Thus this four-point rule estimates the marginal probability of observing \(y=1\) as about 0.5409. The calculation uses the correlated covariance through \(L\), while the nodes themselves come from independent standard-normal coordinates. The large spread in the four predictors also warns that this very low-order rule might not approximate the integral closely; estimates at higher quadrature orders should be compared.
Numerical checks and failure modes
Whitening is algebraically straightforward, but implementation errors can produce plausible-looking yet incorrect likelihoods. The most important checks concern the factorization, the direction of the transformation, and the numerical stability of the covariance matrix.
- Check the factor orientation. With a lower-triangular factor, verify \(\Sigma=LL^\mathsf{T}\), not \(L^\mathsf{T}L\). The two products generally differ.
- Check the direction of the map. To generate random effects from standard-normal nodes use \(b=Lz\). To whiten a given \(b\), solve \(Lz=b\); do not multiply by \(L\).
- Check covariance validity. A positive-definite covariance must have positive Cholesky diagonal entries. Failure of the factorization can indicate an invalid covariance matrix, a matrix that is only positive semidefinite, or numerical roundoff near the boundary.
- Check the numerical residual. After factorization, examine the size of \(LL^\mathsf{T}-\Sigma\). When converting a point back, check that \(Lz-b\) is near zero relative to the scale of the entries.
- Check quadrature convergence separately. A correct whitening transformation does not make a low-order quadrature rule accurate automatically. Compare marginal likelihood estimates across increasing orders or appropriate integration rules.
A covariance matrix with a very high correlation can be positive definite but nearly singular. Then the Cholesky factor has a small diagonal entry, and solving for whitened coordinates can magnify rounding errors. For example, if \( \Sigma=\begin{pmatrix}1&0.99\\0.99&1\end{pmatrix} \), then \( L=\begin{pmatrix}1&0\\0.99&\sqrt{0.0199}\end{pmatrix} \), with \(\sqrt{0.0199}\approx0.1411\). For \(b=(0.5,0.4)^\mathsf{T}\), solving \(Lz=b\) gives \(z_1=0.5\) and \(z_2=(0.4-0.99(0.5))/0.1411\approx-0.6734\). Substitution returns a second component close to \(0.4\), but the division by the relatively small diagonal entry makes accurate arithmetic important.
Worked Example: Whitening Near a High Correlation
Use the near-singular covariance above to verify the transformed coordinates for \(b=(0.5,0.4)^\mathsf{T}\). This matrix is positive definite because its determinant is \(1-0.99^2=0.0199>0\), so the stated Cholesky factor exists.
The first row of \(Lz=b\) gives \(z_1=0.5\). The second row gives \(0.99z_1+\sqrt{0.0199}\,z_2=0.4\), hence
To check, map back: the first component is \(1(0.5)=0.5\), and the second is \(0.99(0.5)+0.141067(-0.6734)\approx0.495-0.095=0.400\). The recovery is consistent to the displayed precision. A small Cholesky diagonal is not itself proof of failure, but it signals that numerical sensitivity deserves attention.
How this approach compares with alternatives
One alternative is to integrate directly in the original \(b\)-coordinates, retaining the correlated Gaussian density explicitly. That is mathematically valid, but a standard independent-normal quadrature rule no longer applies without incorporating the covariance and density carefully. Cholesky whitening makes the standard-normal weight explicit and leaves the conditional likelihood as the function evaluated at transformed nodes.
An eigenvalue factorization can also express a covariance as \(AA^\mathsf{T}\), followed by \(b=Az\). For a positive-definite matrix it provides a valid transformation, although the factor need not be triangular. Cholesky is a conventional choice with a unique lower-triangular factor when the diagonal is required to be positive. If a covariance is exactly rank deficient, an ordinary invertible Cholesky transformation is unavailable; a lower-dimensional representation using only the nonzero covariance directions may be appropriate, but it changes the dimension of integration and requires handling that rank reduction deliberately.
Cholesky whitening does not reduce the number of integration dimensions, remove dependence from the conditional likelihood, or ensure that a chosen quadrature rule is accurate. Tensor-product and sparse-grid quadrature remain alternatives for approximating the standard-normal expectation; the transformation supplies the appropriate coordinates, not a cure for high-dimensional cost. The chosen ordering of random-effect components can affect the triangular factor and therefore the arrangement of finite quadrature points, even though it does not change the exact integral. For an approximate calculation, checking sensitivity to quadrature order—and, when relevant, coordinate ordering—is useful.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- For \(L=\begin{pmatrix}2&0\\1&3\end{pmatrix}\), find \(\Sigma=LL^\mathsf{T}\).
- For the same \(L\), find \(b\) when \(z=(1,-1)^\mathsf{T}\).
- Why does the Jacobian not leave an extra determinant multiplier in the whitened expectation?
- What does failure of an ordinary Cholesky factorization suggest, and what should be checked before changing the model?
Solutions. (1) Multiplication gives \(LL^\mathsf{T}=\begin{pmatrix}4&2\\2&1+9\end{pmatrix} =\begin{pmatrix}4&2\\2&10\end{pmatrix}\). (2) \(b=Lz=(2(1),\,1(1)+3(-1))^\mathsf{T}=(2,-2)^\mathsf{T}\). (3) Since \(|\Sigma|=(\det L)^2\) and the positive diagonal of \(L\) gives \(|\det L|=|\Sigma|^{1/2}\), the change-of-variables Jacobian cancels the density's \(|\Sigma|^{-1/2}\). (4) The covariance may fail to be positive definite, may be only positive semidefinite, or may be affected by numerical roundoff. Check symmetry, the covariance entries, and numerical conditioning; do not assume that an altered covariance is justified without examining the model and computation.