Tutorials › Stochastic Differential Equations in Pharmacokinetics › Constructing Valid Random-Effect Covariance Models

Mixed-Effects SDE Models · Tutorial 81 of 100

Constructing Valid Random-Effect Covariance Models

You will derive and compare three valid covariance parameterizations and learn how to check their positive-definiteness conditions.

Advanced 10 min read

What You'll Learn

  • Explain why a Cholesky factor with positive diagonal produces a positive-definite covariance matrix.
  • Construct a covariance matrix from standard deviations and a valid correlation matrix.
  • Distinguish valid correlation matrices from collections of individually plausible pairwise correlations.
  • Derive the exact positive-definiteness condition for a factor-analytic covariance form.
  • Recognize covariance singularity, factor-rotation ambiguity, and other parameterization diagnostics.
  • Choose a covariance parameterization suited to a random-effects model.

Why Random-Effect Covariance Needs Care

In a mixed-effects pharmacokinetic SDE, a subject may have a vector of random effects \(b_i\), such as deviations in log-clearance and log-volume. A common hierarchical specification is \(b_i\sim N(0,\Omega)\), where \(\Omega\) describes their variances and dependence. A covariance matrix must be symmetric and positive semidefinite; if a nonsingular multivariate normal density is required, it must be positive definite. Parameterizing its entries directly can violate these requirements during estimation.

The goal is therefore not merely to select plausible variances and correlations. It is to choose parameters whose allowed values produce a valid matrix throughout optimization. This tutorial develops three options: a Cholesky factor, standard deviations paired with a correlation matrix, and a factor-analytic form. These describe the random-effect covariance, not the SDE diffusion covariance or observation-error covariance.

Definition: A real \(q\times q\) matrix \(\Omega\) is a covariance matrix if it is symmetric and positive semidefinite: \(x^T\Omega x\geq 0\) for every \(x\in\mathbb R^q\). It is positive definite if \(x^T\Omega x>0\) for every nonzero \(x\). A positive-definite covariance matrix has strictly positive eigenvalues and a nonzero determinant.

Cholesky Parameterization

Write a lower-triangular matrix \(L\) with strictly positive diagonal entries and set \(\Omega=LL^T\). For every nonzero \(x\),

$$ x^T\Omega x=x^TLL^Tx=(L^Tx)^T(L^Tx)=\lVert L^Tx\rVert^2>0. $$

The final inequality follows because \(L\) is invertible: its diagonal entries are positive, so \(L^Tx\neq0\) whenever \(x\neq0\). Thus this construction always gives a positive-definite matrix.

Theorem: Every real symmetric positive-definite matrix \(\Omega\) has a unique factorization \(\Omega=LL^T\), where \(L\) is lower triangular with strictly positive diagonal entries.

Here is a proof by induction on the matrix dimension. For dimension one, \(\Omega=(a)\) with \(a>0\), and \(L=(\sqrt a)\) is the unique factor. For the induction step, partition a positive-definite matrix as

$$ \Omega=\begin{pmatrix}A&c\\c^T&d\end{pmatrix}. $$

The principal block \(A\) is positive definite. By the induction hypothesis, \(A=LL^T\) for a unique lower-triangular \(L\) with positive diagonal. Define \(l=L^{-1}c\). Positive definiteness of \(\Omega\), applied to the nonzero vector \(\begin{pmatrix}-A^{-1}c\\1\end{pmatrix}\), gives \(s=d-c^TA^{-1}c>0\). Since \(A^{-1}=L^{-T}L^{-1}\), we have \(l^Tl=c^TA^{-1}c\). Therefore

$$ \begin{pmatrix}L&0\\l^T&\sqrt{s}\end{pmatrix} \begin{pmatrix}L^T&l\\0&\sqrt{s}\end{pmatrix} = \begin{pmatrix}A&c\\c^T&d\end{pmatrix}. $$

This proves existence. In any such factorization the leading block must be the unique Cholesky factor of \(A\), the last row before its diagonal must solve \(L l=c\), and the final diagonal must be the positive square root of \(s\). This proves uniqueness and completes the induction. \(\square\)

In estimation, diagonal elements of \(L\) can be represented as exponentials of unconstrained real parameters, while the entries below the diagonal can be unconstrained. This guarantees positive diagonal values without requiring an optimizer to enforce inequality constraints. It does not guarantee that estimates are well determined: a matrix can be positive definite but very close to singular.

Worked Example: Building a Two-Effect Covariance by Cholesky

Suppose the lower-triangular factor for two random effects is \(L=\begin{pmatrix}0.20&0\\0.10&0.30\end{pmatrix}\). Compute \(\Omega\) and verify positive definiteness.

Multiplication gives

$$ \Omega=LL^T =\begin{pmatrix}0.20&0\\0.10&0.30\end{pmatrix} \begin{pmatrix}0.20&0.10\\0&0.30\end{pmatrix} =\begin{pmatrix}0.040&0.020\\0.020&0.100\end{pmatrix}. $$

The diagonal entries are the variances, so the standard deviations are \(0.20\) and \(\sqrt{0.100}\approx0.3162\). The covariance is \(0.020\). Directly, the determinant is \(0.040(0.100)-(0.020)^2=0.0036>0\), and the first diagonal entry is positive; hence this symmetric \(2\times2\) matrix is positive definite. Its correlation is \(0.020/(0.20\sqrt{0.100})\approx0.3162\).

Standard Deviations and Correlations

An alternative separates marginal scales from dependence. Let \(D=\operatorname{diag}(\tau_1,\ldots,\tau_q)\), with every \(\tau_j>0\), and let \(R\) be a positive-definite correlation matrix: \(R\) is symmetric, has ones on its diagonal, and is positive definite. Then set \(\Omega=DRD\). For nonzero \(x\), \(Dx\neq0\), so \(x^T\Omega x=(Dx)^TR(Dx)>0\). Conversely, given any positive-definite \(\Omega\), its diagonal entries are positive; setting \(\tau_j=\sqrt{\Omega_{jj}}\) and \(R=D^{-1}\Omega D^{-1}\) gives a positive-definite correlation matrix. Thus the representation covers precisely the positive-definite covariance matrices when the scales are positive and \(R\) is positive definite.

The decomposition is useful for interpretation: \(\tau_j\) is the standard deviation of effect \(j\), and \(R_{jk}\) is the correlation between effects \(j\) and \(k\). But choosing each pairwise correlation independently from \((-1,1)\) does not ensure that the whole matrix \(R\) is positive definite. For three effects with correlations \(r_{12},r_{13},r_{23}\), the determinant must also satisfy

$$ \det(R)=1+2r_{12}r_{13}r_{23}-r_{12}^2-r_{13}^2-r_{23}^2>0. $$

A valid way to parameterize \(R\) is through its own Cholesky factor, with constraints chosen to keep the diagonal equal to one after reconstruction. Other constructions use partial correlations. The essential requirement is that the chosen parameterization generate a valid correlation matrix, rather than treating all pairwise entries as independent free parameters.

Worked Example: Checking a Three-Effect Correlation Model

Take standard deviations \((0.20,0.30,0.10)\) and propose correlations \(r_{12}=0.50\), \(r_{13}=0.20\), and \(r_{23}=0.40\). The correlation matrix is

$$ R=\begin{pmatrix}1&0.50&0.20\\0.50&1&0.40\\0.20&0.40&1\end{pmatrix}. $$

Its leading principal minors are \(1\), \(1-0.50^2=0.75\), and \(1+2(0.50)(0.20)(0.40)-0.50^2-0.20^2-0.40^2=0.63\). They are all positive, so \(R\) is positive definite. With \(D=\operatorname{diag}(0.20,0.30,0.10)\), the covariance is

$$ \Omega=DRD= \begin{pmatrix} 0.040&0.030&0.004\\ 0.030&0.090&0.012\\ 0.004&0.012&0.010 \end{pmatrix}. $$

For a check independent of the minors, \(\det(\Omega)=(\det D)^2\det(R)=(0.20\cdot0.30\cdot0.10)^2(0.63)=0.00002268>0\). Since it is congruent to the positive-definite \(R\) by an invertible \(D\), \(\Omega\) is positive definite.

Factor-Analytic Covariance Models

When many random effects share a lower-dimensional dependence structure, a factor-analytic model can use fewer parameters than a fully unrestricted covariance matrix. Write

$$ \Omega=\Lambda\Lambda^T+\Psi, $$

where \(\Lambda\) is a \(q\times k\) loading matrix and \(\Psi=\operatorname{diag}(\psi_1,\ldots,\psi_q)\), with every \(\psi_j\geq0\). The first term represents covariance induced by \(k\) latent factors; \(\Psi\) represents effect-specific residual variances. For any \(x\),

$$ x^T\Omega x=\lVert\Lambda^Tx\rVert^2+\sum_{j=1}^q\psi_jx_j^2\geq0. $$

This proves that the form is always positive semidefinite. Its exact positive-definiteness condition, including the case of zero residual variances, follows directly from the same expression.

Theorem: For \(\Omega=\Lambda\Lambda^T+\operatorname{diag}(\psi_1,\ldots,\psi_q)\), where \(\psi_j\geq0\), \(\Omega\) is positive definite if and only if the only vector \(x\) satisfying both \(\Lambda^Tx=0\) and \(x_j=0\) for every index \(j\) with \(\psi_j>0\) is \(x=0\).

To prove the forward direction, suppose a nonzero \(x\) satisfies those two conditions. Then \(\lVert\Lambda^Tx\rVert^2=0\). Every term with \(\psi_j>0\) vanishes because \(x_j=0\), and every term with \(\psi_j=0\) vanishes because its coefficient is zero. Thus \(x^T\Omega x=0\), contradicting positive definiteness.

For the reverse direction, suppose \(\Omega\) is not positive definite. It is positive semidefinite by the displayed sum of nonnegative terms, so there is a nonzero \(x\) with \(x^T\Omega x=0\). A sum of nonnegative terms can equal zero only if each term equals zero. Therefore \(\Lambda^Tx=0\), and \(\psi_jx_j^2=0\) for every \(j\). Whenever \(\psi_j>0\), this implies \(x_j=0\). The assumed condition says the only such vector is zero, contradicting the choice of \(x\). Hence \(\Omega\) is positive definite. \(\square\)

A particularly simple sufficient condition is \(\psi_j>0\) for every \(j\): then \(x^T\Psi x>0\) for every nonzero \(x\). It is sufficient, not necessary. The theorem also permits some zero diagonal residual variances if the factor term and the remaining positive residual variances together leave no nonzero null direction.

Worked Example: A Factor-Analytic Covariance and a Boundary Case

First take one factor with \(\Lambda=(0.30,0.20)^T\) and \(\Psi=\operatorname{diag}(0.04,0.09)\). Then

$$ \Lambda\Lambda^T= \begin{pmatrix}0.09&0.06\\0.06&0.04\end{pmatrix}, \qquad \Omega= \begin{pmatrix}0.13&0.06\\0.06&0.13\end{pmatrix}. $$

The determinant is \(0.13^2-0.06^2=0.0133>0\), and the first diagonal entry is positive, so \(\Omega\) is positive definite. Now consider \(\Psi=\operatorname{diag}(1,0)\) and \(\Lambda=(0,1)^T\). Then

$$ \Omega=\begin{pmatrix}1&0\\0&1\end{pmatrix}. $$

Although the nonzero vector \(x=(1,0)^T\) satisfies \(\Lambda^Tx=0\), it does not satisfy the full null condition: \(x_1\neq0\) and \(\psi_1>0\). The only vector satisfying both \(\Lambda^Tx=0\) and \(x_j=0\) at every positive-\(\psi_j\) index is therefore zero, as required for positive definiteness.

Choosing a Form and Checking a Fit

FormStrengthImportant caution
Cholesky, \(\Omega=LL^T\)Directly guarantees positive definiteness and covers every positive-definite covariance.Entries of \(L\) may be less immediately interpretable as marginal scales and correlations.
Standard deviations and correlations, \(\Omega=DRD\)Separates interpretable marginal variability from association.The correlation matrix must be jointly positive definite; pairwise bounds alone are insufficient.
Factor analytic, \(\Omega=\Lambda\Lambda^T+\Psi\)Can represent structured covariance with fewer parameters when the factor dimension is small.Loadings are not generally unique: rotating \(\Lambda\) by an orthogonal matrix leaves \(\Lambda\Lambda^T\) unchanged.

The factor-analytic form is positive semidefinite by construction, but that alone does not guarantee a nonsingular covariance. Enforcing strictly positive residual variances is a convenient sufficient safeguard; allowing zeros requires checking the theorem’s exact condition. Also, if \(Q\) is an orthogonal \(k\times k\) matrix, then \((\Lambda Q)(\Lambda Q)^T=\Lambda\Lambda^T\). Consequently, the loading values themselves may not be uniquely identified without additional constraints, even when the covariance is well defined.

Practical diagnostics include checking symmetry, positive eigenvalues or successful Cholesky factorization, and the smallest eigenvalue or condition number. A very small eigenvalue signals near-singularity and can cause unstable likelihood calculations or large changes in fitted correlations from small data perturbations. Inspect estimated standard deviations and correlations on their interpretable scales, and check for estimates near parameter boundaries. If an optimizer proposes a non-positive-definite correlation matrix, the issue is not repaired by interpreting its pairwise entries separately: the joint matrix must be reparameterized or constrained.

There is no universally best form. Cholesky is a robust general-purpose choice for an unrestricted positive-definite covariance. The standard-deviation–correlation form is attractive when marginal scales and associations are the quantities of scientific interest, provided \(R\) is valid by construction. A factor-analytic form is useful when a lower-rank dependence structure is scientifically and statistically defensible, but its dimension and loading constraints affect interpretation. All three restrict or organize the parameters differently; none can compensate for weak information in the data.

Common Mistakes and Limitations

  • Checking only the diagonal. Positive variances do not ensure positive definiteness. Off-diagonal values can make a matrix invalid.
  • Checking correlations one at a time. Each correlation can lie between \(-1\) and \(1\) while the complete correlation matrix is not positive definite.
  • Confusing positive semidefinite with positive definite. A factor-analytic construction with zero residual variances can be singular; its loading matrix must be considered as well.
  • Assuming parameterization solves identifiability. A guaranteed-valid matrix can still be poorly determined by the observed subjects or have redundant factor loadings.

These parameterizations ensure matrix validity under their stated conditions; they do not establish that a particular covariance structure is scientifically appropriate, estimable from a given sample, or adequate for the random effects in a PK SDE.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Why does \(LL^T\) have to be positive definite when \(L\) is lower triangular with strictly positive diagonal entries?
  2. A two-effect correlation matrix has correlation \(r=0.8\). Is it positive definite, and what is its determinant?
  3. For a factor-analytic covariance, what condition on \(\Psi\) is a simple sufficient guarantee of positive definiteness?
  4. Why are the entries of a factor loading matrix not necessarily uniquely determined by the covariance?

Solutions. (1) For nonzero \(x\), \(x^TLL^Tx=\lVert L^Tx\rVert^2\). The positive diagonal makes \(L\) invertible, so \(L^Tx\neq0\), and the squared norm is strictly positive. (2) The matrix is \(\begin{pmatrix}1&0.8\\0.8&1\end{pmatrix}\), whose determinant is \(1-0.8^2=0.36>0\); its first leading minor is \(1>0\), so it is positive definite. (3) Require every diagonal entry \(\psi_j>0\). Then \(x^T\Psi x>0\) for every nonzero \(x\), and adding the nonnegative term \(\lVert\Lambda^Tx\rVert^2\) preserves strict positivity. (4) For any orthogonal \(Q\), \((\Lambda Q)(\Lambda Q)^T=\Lambda QQ^T\Lambda^T=\Lambda\Lambda^T\); different loadings can therefore produce the same covariance.

Clinical Biostats