Why Parameterize a Covariance Matrix?
In a generalized linear mixed model, random effects represent group-specific departures from the fixed-effects structure. Their covariance matrix determines how those departures vary and co-vary. Estimation is therefore not just a search for numerical values: every candidate covariance matrix must be mathematically admissible. In particular, a covariance matrix must be symmetric and positive semidefinite. A parameterization that produces invalid matrices can cause an optimizer to spend effort outside the model’s allowable parameter space.
The Cholesky parameterization addresses this constraint by expressing a positive-definite covariance matrix as a product of a lower-triangular matrix and its transpose. This gives the optimizer coordinates that generate valid matrices throughout the interior of the parameter space. It does not, by itself, guarantee that the likelihood is well behaved or that the estimated components are numerically stable. Those questions still require diagnostics.
For example, with a random intercept and a random slope, one group’s linear predictor may contain \(b_{0j}+b_{1j}x_{ij}\). The vector \(b_j=(b_{0j},b_{1j})^\mathsf{T}\) has a two-by-two covariance matrix. The response distribution is specified conditional on the random effects, and observations are ordinarily assumed conditionally independent given those effects and the covariates. The Cholesky factor concerns the distribution of the random effects; it does not change the chosen response distribution or link function.
How the Factor Guarantees Validity
For two random effects, write the lower-triangular factor as \(L\). Multiplying \(L\) by its transpose gives the covariance entries directly:
The matrix is symmetric by construction. Its first diagonal entry is \(a^2\), and its second is \(c^2+d^2\), so both are nonnegative. More importantly, its determinant is \(a^2d^2\). If \(a>0\) and \(d>0\), then both diagonal entries and the determinant are positive, which makes this two-by-two symmetric matrix positive definite. The same argument extends to \(q\) dimensions: for any nonzero vector \(v\),
because a triangular \(L\) with nonzero diagonal is invertible, so \(L^\mathsf{T}v\ne 0\). Thus the product representation guarantees positive definiteness when the factor has a nonzero diagonal. This is a validity result, not a guarantee that the data identify every covariance component well.
A frequent optimization convention is to set each diagonal entry to an exponential, such as \(a=\exp(\eta_1)\) and \(d=\exp(\eta_2)\), while leaving the off-diagonal entry \(c\) unconstrained. This allows the optimizer to work with unrestricted real-valued coordinates \(\eta_1,\eta_2,c\), while ensuring that \(a,d>0\). Implementations may use a scaled version of this construction or a different internal convention, so reported optimizer parameters need not equal the displayed entries of \(L\).
Worked Example: Recovering Variances and Correlation
Suppose a hypothetical logistic GLMM has a random intercept and a random slope for a predictor measured in units of 10. Suppose the fitted Cholesky factor, in that order, is \(L=\begin{pmatrix}0.8&0\\0.3&0.6\end{pmatrix}\). The intercept is on the log-odds scale, and the slope is change in log odds per 10 predictor units.
First calculate \(G=LL^\mathsf{T}\):
The estimated random-intercept variance is \(0.64\), and the random-slope variance is \(0.45\). Their standard deviations are \(\sqrt{0.64}=0.800\) log-odds units and \(\sqrt{0.45}\approx0.671\) log-odds per 10 predictor units, respectively. The covariance is \(0.24\), in the product of those units. The correlation is \[ 0.24\big/\{\sqrt{0.64}\sqrt{0.45}\} \approx 0.447. \] The determinant is \(0.64(0.45)-0.24^2=0.2304>0\), consistent with a positive-definite matrix. The positive covariance means that groups with higher-than-average random intercepts tend, under this fitted model, also to have higher-than-average random slopes.
Cholesky Coordinates Are Not Correlations
The entries of \(L\) are computational coordinates. Except in special cases, they are not the standard deviations, variances, or correlations that researchers usually report. For a two-dimensional random effect with standard deviations \(\sigma_1,\sigma_2\) and correlation \(\rho\), one valid Cholesky factor is
Multiplication gives diagonal entries \(\sigma_1^2\) and \(\sigma_2^2\), and off-diagonal entry \(\rho\sigma_1\sigma_2\). Notice that \(L_{21}=\rho\sigma_2\), not \(\rho\), and \(L_{22}\) is not generally \(\sigma_2\). In dimensions above two, the relationship between a Cholesky factor and the resulting correlations is more involved still.
Worked Example: Constructing a Factor From Standard Deviations and Correlation
Consider hypothetical random effects with standard deviations \(0.50\) and \(0.40\), and correlation \(-0.60\). The factor entries are
Therefore,
The covariance is \(-0.12=(-0.60)(0.50)(0.40)\), and dividing it by the product of the standard deviations returns the correlation \(-0.60\). The diagonal entries of \(L\) are \(0.50\) and \(0.32\); the second is not the second random-effect standard deviation.
When fitting by maximum likelihood, re-expressing the covariance parameters in Cholesky coordinates does not add a Jacobian term to the likelihood. The likelihood is evaluated at the covariance matrix generated by the current optimizer coordinates. A Jacobian is relevant when transforming a probability density on parameters, as in a Bayesian prior transformation; that is a different calculation from maximizing the likelihood over a reparameterized model.
Scaling, Conditioning, and Diagnostics
A valid matrix can still be numerically awkward. Random-intercept and random-slope components often have different units and magnitudes, especially when the predictor is recorded on a large scale. The resulting covariance coordinates can differ greatly in size. This can make numerical optimization less well scaled and make small changes in one component difficult to compare with changes in another. Scaling the predictor changes the units and numerical values of the slope component; it does not change the underlying fitted linear predictor when the coefficients are transformed consistently.
Worked Example: Rescaling a Random-Slope Predictor
Suppose a hypothetical model uses predictor \(x\), measured in units from 0 to 1000. Its random intercept has standard deviation \(0.50\), its random slope per one unit of \(x\) has standard deviation \(0.005\), and their correlation is \(0.40\). The covariance matrix is
Now define \(z=x/100\), so \(x=100z\). The same random contribution can be written \(b_0+b_1x=b_0+(100b_1)z\). Thus the slope coefficient on the \(z\) scale is \(c_1=100b_1\). Its standard deviation is \(100(0.005)=0.50\), its covariance with the intercept is \(100(0.001)=0.10\), and its variance is \(10000(0.000025)=0.25\). The transformed covariance matrix is
The correlation remains \(0.40\), and the group-specific linear predictors are unchanged. The entries are now on more comparable scales, which can make optimization better scaled. Rescaling cannot create information absent from the data, and it does not guarantee convergence; it is a targeted numerical adjustment, not proof that the fitted covariance is reliable.
Useful checks include confirming that the reported covariance matrix is symmetric, recalculating its standard deviations and correlations from its entries, and checking that its entries agree with the fitted factor under the software’s stated convention. Compare results across sensible predictor scales or equivalent parameterizations when numerical behavior is concerning. Also examine the convergence message, scaled gradient, Hessian, and optimizer sensitivity using the corresponding diagnostics. A convergence flag alone does not establish that every component is accurately estimated.
Determine whether the software reports a covariance matrix, standard deviations and correlations, or Cholesky-factor parameters. Do not interpret factor entries as correlations without conversion.
Form \(LL^\mathsf{T}\) using the documented ordering and scaling. Compare the result with the reported variances and covariances.
Check whether random-slope units or predictor magnitudes make covariance components very different in size. Consider a scientifically interpretable rescaling and refit.
Check convergence information and curvature diagnostics, and determine whether equivalent fits give materially similar estimates. A valid Cholesky factor does not rule out weak information or numerical instability.
Choices and Limitations
Directly optimizing all covariance entries is easy to describe, but arbitrary entries need not produce a positive-semidefinite matrix. Constraints can be added, but they are themselves a numerical problem. A standard-deviation-and-correlation parameterization is often easier to interpret, but it also requires constraints: standard deviations must be nonnegative and the correlation structure must be valid. The Cholesky representation enforces positive definiteness through its factor structure and is consequently a common computational choice.
The choice is not cost-free. Cholesky entries depend on the ordering of the random effects, and their magnitudes depend on the units used. They are useful for computation but are usually less directly interpretable than variances, standard deviations, and correlations. Further, strictly positive diagonal entries represent positive-definite matrices in the interior; they do not represent every positive-semidefinite matrix exactly. A Cholesky parameterization therefore ensures validity of generated matrices, not adequate data support, good conditioning, or a scientifically appropriate random-effects structure.
Check Your Understanding
Answer each question, then compare with the brief solutions.
- For \(L=\begin{pmatrix}0.6&0\\0.2&0.5\end{pmatrix}\), calculate \(G=LL^\mathsf{T}\), its two standard deviations, and the correlation.
- Why does a lower-triangular factor with positive diagonal entries produce a positive-definite covariance matrix?
- If a predictor is replaced by \(z=x/10\), how does the random-slope coefficient change so that the linear predictor stays the same?
- Does a Cholesky parameterization guarantee that covariance components are well estimated? Give one reason.
Solutions. (1) \(G=\begin{pmatrix}0.36&0.12\\0.12&0.29\end{pmatrix}\); the standard deviations are \(0.600\) and \(\sqrt{0.29}\approx0.539\), and the correlation is \(0.12/(0.600\sqrt{0.29})\approx0.372\). (2) For nonzero \(v\), \(v^\mathsf{T}LL^\mathsf{T}v=\lVert L^\mathsf{T}v\rVert^2>0\), since the factor is invertible. (3) Since \(x=10z\), the coefficient on \(z\) must be \(10b_1\). (4) No. It guarantees a valid positive-definite matrix, but the data may provide weak information about components, or the optimization may still be poorly conditioned.