Tutorials › Nonlinear Mixed-Effects Models (NLME) › Transforming Random-Effect Covariances Between Parameterizations

Between-Subject, Between-Occasion and Residual Variability · Tutorial 115 of 797

Transforming Random-Effect Covariances Between Parameterizations

Use a transformation’s Jacobian to approximate the covariance matrix of transformed random effects, and assess when that approximation is useful.

Intermediate 10 min read

What You'll Learn

  • Write a covariance transformation using the Jacobian and the original random-effect covariance matrix.
  • Distinguish transformations of natural-scale parameters from transformations of log-scale random effects.
  • Calculate approximate covariance between two-compartment macroconstants from random microconstants.
  • Interpret transformed variances and covariances on the scale where they are defined.
  • Recognize when curvature or near-degenerate parameter values can make a first-order approximation unreliable.

Why Transforming Random-Effect Covariances Matters

A pharmacokinetic model may be written using one set of structural parameters but interpreted or reported using another. For example, a two-compartment model can use microconstants such as \(k_{10}\), \(k_{12}\), and \(k_{21}\), while its concentration-time curve is described by macroconstants \(\alpha\) and \(\beta\). If subjects vary jointly in the microconstants, their macroconstants also vary jointly. The question is how to approximate the variances and covariance after this nonlinear transformation.

The answer depends on the scale of the random effects. In particular, transforming natural-scale parameters and transforming log-scale random effects are related but are not the same calculation. The delta method provides a local, first-order approximation: it uses the derivative of the transformation near the typical parameter values to carry the covariance forward.

Definition: Let \(\boldsymbol{\eta}\) be a vector of mean-zero random effects with covariance matrix \(\Omega\). If a vector of transformed random effects is \(\boldsymbol{\xi}=h(\boldsymbol{\eta})\), and \(h\) is differentiable near \(\boldsymbol{\eta}=\mathbf{0}\), define the Jacobian \(G\) by \(G_{ij}=\left.\partial h_i/\partial\eta_j\right|_{\boldsymbol{\eta}=\mathbf{0}}\). The first-order delta-method approximation is \(\operatorname{Cov}(\boldsymbol{\xi})\approx G\Omega G^{T}\).

The Covariance Transformation

For a vector of natural-scale parameters \(\boldsymbol{\theta}\) with mean or expansion point \(\boldsymbol{\theta}_0\), and a differentiable transformation \(\mathbf{z}=g(\boldsymbol{\theta})\), the corresponding approximation is

$$ \operatorname{Cov}(\mathbf{z})\approx J_g(\boldsymbol{\theta}_0)\, \operatorname{Cov}(\boldsymbol{\theta})\,J_g(\boldsymbol{\theta}_0)^T, \qquad (J_g)_{ij}=\left.\frac{\partial g_i}{\partial\theta_j}\right|_{\boldsymbol{\theta}_0}. $$

This follows by a first-order Taylor expansion:

$$ g(\boldsymbol{\theta})\approx g(\boldsymbol{\theta}_0) +J_g(\boldsymbol{\theta}_0)(\boldsymbol{\theta}-\boldsymbol{\theta}_0). $$

The constant term has zero covariance with everything, and for any fixed matrix \(A\), \(\operatorname{Cov}(A\mathbf{X})=A\operatorname{Cov}(\mathbf{X})A^T\). Applying that identity to the linear term gives the stated approximation. The approximation neglects second- and higher-order terms in the Taylor expansion; it is not generally an exact transformation of the full random-effects distribution.

In a common lognormal parameterization, \(\theta_j=\theta_{j,\mathrm{pop}}\exp(\eta_j)\), where \(\eta_j\) is a mean-zero random effect. For positive transformed parameters \(z_i=g_i(\boldsymbol{\theta})\), define the transformed log effect as \(\xi_i=\log\{g_i(\boldsymbol{\theta})/g_i(\boldsymbol{\theta}_{\mathrm{pop}})\}\). The Jacobian with respect to the original random effects is then

$$ G_{ij}= \left. \frac{\partial \xi_i}{\partial\eta_j} \right|_{\boldsymbol{\eta}=\mathbf{0}} = \left. \frac{\theta_j}{g_i(\boldsymbol{\theta})} \frac{\partial g_i(\boldsymbol{\theta})}{\partial\theta_j} \right|_{\boldsymbol{\theta}=\boldsymbol{\theta}_{\mathrm{pop}}}. $$

The resulting \(G\Omega G^T\) is a covariance matrix for the transformed log effects. To approximate the covariance matrix of the transformed natural-scale parameters themselves, the Jacobian must instead be taken for \(g(\boldsymbol{\theta})\), or the local log-effect covariance must be rescaled by the typical transformed values.

Worked Example: A Ratio of Two Log-Scale Parameters

Suppose hypothetical clearance and volume parameters have log random effects \(\eta_{CL}\) and \(\eta_V\), with variances \(0.09\) and \(0.04\), and covariance \(0.03\). Consider the elimination rate \(k=CL/V\). Its log effect relative to its typical value is

$$ \xi_k=\log\left(\frac{CL/V}{CL_{\mathrm{pop}}/V_{\mathrm{pop}}}\right) =\eta_{CL}-\eta_V. $$

This is a linear transformation, so the covariance calculation is exact. The transformation matrix from \((\eta_{CL},\eta_V)^T\) to \((\eta_{CL},\xi_k)^T\) is \(A=\begin{pmatrix}1&0\\1&-1\end{pmatrix}\). Therefore,

$$ A \begin{pmatrix}0.09&0.03\\0.03&0.04\end{pmatrix} A^T = \begin{pmatrix}0.09&0.06\\0.06&0.07\end{pmatrix}. $$

Thus the log-scale variance of \(k\) is \(0.09+0.04-2(0.03)=0.07\), and the covariance between the log effects for clearance and \(k\) is \(0.09-0.03=0.06\). Their correlation is \(0.06/\sqrt{(0.09)(0.07)}\approx0.756\). These are dimensionless log-effect quantities; \(k\) itself is measured in inverse time. Because the transformed log effect is exactly linear in the original log effects, no first-order approximation is needed here.

From Microconstants to Macroconstants

For a standard two-compartment model with elimination from the central compartment, the two positive macroconstants are the roots of \(\lambda^2-S\lambda+P=0\), where \(S=k_{10}+k_{12}+k_{21}\) and \(P=k_{10}k_{21}\). When \(S^2-4P>0\), they are

$$ \alpha=\frac{S+\sqrt{S^2-4P}}{2}, \qquad \beta=\frac{S-\sqrt{S^2-4P}}{2}, \qquad \alpha>\beta>0. $$

These formulas define a nonlinear transformation. If the microconstants have log random effects, the needed Jacobian is the derivative of \((\log\alpha,\log\beta)\) with respect to those log effects, evaluated at the typical microconstants. One convenient derivative follows by differentiating the root equation \(\lambda^2-S\lambda+P=0\):

$$ \frac{\partial\lambda}{\partial k_j} = \frac{\lambda\,\partial S/\partial k_j-\partial P/\partial k_j}{2\lambda-S}, \qquad \frac{\partial\log\lambda}{\partial\eta_j} = \frac{k_j}{\lambda}\frac{\partial\lambda}{\partial k_j}. $$

Here \(k_j=k_{j,\mathrm{pop}}\exp(\eta_j)\), so \(\partial k_j/\partial\eta_j=k_j\) at the expansion point. The denominator \(2\lambda-S\) is \(+\sqrt{S^2-4P}\) for \(\alpha\) and \(-\sqrt{S^2-4P}\) for \(\beta\).

Worked Example: Approximate Macroconstant Covariances

Consider hypothetical typical microconstants \(k_{10}=0.20\), \(k_{12}=0.30\), and \(k_{21}=0.10\ \mathrm{h}^{-1}\). Suppose their independent log random effects have variances \(0.04\), \(0.01\), and \(0.04\), respectively. Independence is an explicit assumption here, so \(\Omega=\operatorname{diag}(0.04,0.01,0.04)\). First calculate \(S=0.60\ \mathrm{h}^{-1}\), \(P=0.020\ \mathrm{h}^{-2}\), and \(\sqrt{S^2-4P}=\sqrt{0.28}=0.5292\ \mathrm{h}^{-1}\). Thus \(\alpha=0.5646\ \mathrm{h}^{-1}\) and \(\beta=0.03542\ \mathrm{h}^{-1}\), both positive and distinct as required for the formulas above.

Using the root derivatives, followed by multiplication by \(k_j/\lambda\), gives the Jacobian for the macroconstant log effects with respect to \((\eta_{10},\eta_{12},\eta_{21})\):

$$ G\approx \begin{pmatrix} 0.3110&0.5674&0.1221\\ 0.6890&-0.5674&0.8780 \end{pmatrix}. $$

For example, the first entry is \(k_{10}(\alpha-k_{21})/[\alpha\sqrt{S^2-4P}]\), which evaluates to approximately \(0.3110\). The negative middle entry in the second row reflects that increasing \(k_{12}\), locally, decreases \(\beta\). Now apply the delta method:

$$ G\Omega G^T\approx \begin{pmatrix} 0.007684&0.009637\\ 0.009637&0.05304 \end{pmatrix}. $$

The diagonal entries approximate the log-scale variances of \(\alpha\) and \(\beta\), and the off-diagonal entry is their approximate log-scale covariance. The corresponding correlation is \(0.009637/\sqrt{(0.007684)(0.05304)}\approx0.477\). A positive covariance is possible even though one sensitivity is negative: the covariance combines the products of sensitivities across all three independent random effects, and the positive contributions outweigh the negative one.

If natural-scale covariance is needed, the same local approximation gives \(\operatorname{Var}(\alpha)\approx\alpha^2(0.007684)=0.002449\ \mathrm{h}^{-2}\), \(\operatorname{Var}(\beta)\approx\beta^2(0.05304)=0.00006657\ \mathrm{h}^{-2}\), and \(\operatorname{Cov}(\alpha,\beta)\approx\alpha\beta(0.009637)=0.0001927\ \mathrm{h}^{-2}\). These are approximations around the transformed typical values, not claims that the transformed parameters are normally distributed.

Scale, Curvature, and Approximation Quality

A covariance has meaning only together with the scale of the variables. A variance of a log effect is dimensionless; a natural-scale variance has squared parameter units. Likewise, a natural-scale covariance between \(\alpha\) and \(\beta\) has units of \(\mathrm{h}^{-2}\), while their log-effect covariance is dimensionless. Do not transfer a numerical covariance from one scale to another without the appropriate Jacobian or local rescaling.

Worked Example: Reciprocal Transformation and Curvature

Suppose a hypothetical rate has \(k_{\mathrm{pop}}=0.20\ \mathrm{h}^{-1}\) and \(k=k_{\mathrm{pop}}\exp(\eta)\), with \(\eta\sim N(0,0.09)\). Its half-life is \(T=\log(2)/k\). Since \(\log\{T/T_{\mathrm{pop}}\}=-\eta\), the log-half-life variance is exactly \(0.09\). On the natural scale, \(T_{\mathrm{pop}}=\log(2)/0.20=3.466\ \mathrm{h}\). The delta method gives

$$ \operatorname{Var}(T)\approx \left(\left.\frac{dT}{dk}\right|_{k_{\mathrm{pop}}}\right)^2 \operatorname{Var}(k) \approx T_{\mathrm{pop}}^2(0.09) =(3.466)^2(0.09)\approx1.081\ \mathrm{h}^2. $$

This calculation uses \(\operatorname{Var}(k)\approx k_{\mathrm{pop}}^2(0.09)\), the first-order approximation for the natural-scale rate variance. Because \(\eta\) is normally distributed, the exact natural-scale half-life variance is \(T_{\mathrm{pop}}^2\exp(0.09)\{\exp(0.09)-1\}\approx1.238\ \mathrm{h}^2\). The difference illustrates the effect of curvature; the exact log-scale result remains especially simple because the log half-life is exactly a linear function of \(\eta\).

The delta method is most useful when random effects are sufficiently concentrated near the expansion point and the transformation is smooth there. Check whether the Jacobian is finite and whether plausible random-effect values remain in the transformation’s valid domain. In the two-compartment example, as \(S^2-4P\) approaches zero, the macroconstants approach one another and derivatives involving \(1/\sqrt{S^2-4P}\) can become large. The local approximation may then be unstable, even if the typical values still satisfy the root formulas.

A transformed covariance matrix from \(G\Omega G^T\) is positive semidefinite when \(\Omega\) is positive semidefinite, but that algebraic property does not establish that the approximation describes the full transformed distribution well. Large transformed variances, strong curvature, or simulated parameter draws near invalid regions are reasons to be cautious. If the transformation is linear, covariance propagation is exact. For a clearly nonlinear transformation, one alternative is to transform representative draws from the specified random-effects distribution and calculate their empirical covariance; this retains curvature but depends on the distributional assumptions and the adequacy of the simulation.

Common Pitfall

Common mistake: “The transformed covariance is the original covariance with the parameter names changed.” This is wrong unless the transformation leaves the relevant random effects unchanged. Correction: calculate the Jacobian on the intended scale and use \(G\Omega G^T\). Also state whether the result concerns natural parameters or their log effects; the units and numerical values differ.

A second frequent error is evaluating a derivative at an arbitrary value rather than at the point defining the random effects. For lognormal effects centered at \(\boldsymbol{\eta}=\mathbf{0}\), evaluate at the typical parameters \(\boldsymbol{\theta}_{\mathrm{pop}}\). The transformation of typical values need not equal the mean of the transformed random parameters, especially under substantial variability and curvature.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. If \(\mathbf{z}=A\boldsymbol{\eta}\), what covariance matrix does the delta method give, and when is it exact?
  2. For a log-scale rate effect \(\eta_k=\eta_{CL}-\eta_V\), with variances \(0.05\) and \(0.02\) and covariance \(0.01\), what is the variance of \(\eta_k\)?
  3. Why can the macroconstant covariance in the two-compartment example be positive even though one Jacobian entry is negative?
  4. What feature of the two-compartment transformation warns that the local approximation may become unreliable?

Solutions. (1) The covariance is \(A\Omega A^T\), and this is exact for a linear transformation. (2) \(\operatorname{Var}(\eta_k)=0.05+0.02-2(0.01)=0.05\). (3) The covariance sums products of sensitivities weighted by the corresponding variances; positive products can outweigh a negative product. (4) As \(S^2-4P\) approaches zero, the roots approach one another and derivatives containing \(1/\sqrt{S^2-4P}\) can become large.