Tutorials › Nonlinear Mixed-Effects Models (NLME) › Drawing Random Effects From an NLME Model

Simulation From Fitted Models · Tutorial 680 of 797

Drawing Random Effects From an NLME Model

Learn to draw one random-effect vector per simulated subject from the fitted distribution and use the model’s parameterization to calculate individual pharmacokinetic values.

Intermediate 10 min read

What You'll Learn

  • Distinguish population random-effect draws from conditional subject estimates and residual error
  • Use the fitted random-effect distribution and its estimated scale parameters
  • Map a complete random-effect vector to individual pharmacokinetic parameters
  • Check units, parameter constraints, and whether the resulting draws are plausible
  • Identify when a diagonal-draw calculation does not represent the fitted joint distribution

Why Draw Random Effects?

A fitted NLME model describes both population-level parameters and how individuals vary around them. To simulate a new individual, it is not enough to use only the population-typical pharmacokinetic parameters: that would give every simulated individual the same parameter values. A subject-level random-effect draw represents between-individual variation under the fitted model. The model’s parameterization then maps that draw to individual parameters such as clearance, volume, or absorption rate.

The target here is a draw from the fitted population distribution of random effects. It is not an estimate of the random effects for a subject whose concentration data have already been observed. That distinction matters: a population draw represents a new individual under the model, whereas a conditional estimate uses information from that individual’s observations.

Definition: For subject \(i\), let \(\boldsymbol{\eta}_i\) be the vector of random effects in the fitted model. Under the usual normal random-effects assumption, \(\boldsymbol{\eta}_i \sim N(\mathbf{0},\Omega)\), where \(\mathbf{0}\) is the zero vector and \(\Omega\) is the random-effects covariance matrix. In a simulation that treats the fitted distribution as fixed, draw \(\boldsymbol{\eta}_i^{(m)}\) from \(N(\mathbf{0},\hat{\Omega})\), where \(\hat{\Omega}\) is the fitted estimate of \(\Omega\) and \(m\) indexes the simulated subject.

From a Random-Effect Vector to PK Parameters

A random-effect vector is not itself a vector of pharmacokinetic parameters. The fitted model specifies how to combine its components with population parameters and, where applicable, covariates. Write this mapping generally as \(\boldsymbol{\psi}_i=g(\boldsymbol{\psi}_{\mathrm{pop}},x_i,\boldsymbol{\eta}_i)\), where \(\boldsymbol{\psi}_{\mathrm{pop}}\) denotes population parameters and \(x_i\) denotes the subject’s covariates. For a simulated subject, substitute the drawn vector into the model’s specified mapping; do not invent a different mapping after drawing.

For example, a model might use an additive random effect for clearance, \(CL_i=CL_{\mathrm{pop}}+\eta_{CL,i}\). In that parameterization, \(\eta_{CL,i}\) has the same units as clearance. Other models may use a different scale or transformation. The appropriate mapping is the one in the fitted model, with its units and constraints respected.

The distributional assumption is substantive. The normal model specifies a zero mean for the random effects and uses \(\Omega\) to describe their variances and covariances. It also implies that, under an unbounded normal distribution, any finite random-effect value is possible. A chosen parameter mapping may therefore produce values that are implausible or violate a parameter constraint. Such a result is a reason to inspect the model and parameterization, not an automatic instruction to alter the draw.

Drawing and Applying the Vector

For a model with \(q\) random effects, each simulated subject receives one \(q\)-component vector. All components for a subject are used together in the mapping to that subject’s PK parameters. If the model’s fitted covariance matrix has nonzero off-diagonal entries, the joint draw must represent those entries; drawing each component independently would instead impose a diagonal covariance matrix. The worked calculations below use explicitly diagonal covariance matrices so that the component-wise arithmetic is transparent. They do not describe a substitute for a fitted covariance matrix with nonzero covariances.

When the covariance matrix is diagonal, each component can be written as \(\eta_{j,i}=\sigma_j Z_{j,i}\), where \(Z_{j,i}\sim N(0,1)\) and \(\sigma_j\) is the fitted random-effect standard deviation. This is a convenient way to express a draw, not a change to the model: the resulting component has mean zero and variance \(\sigma_j^2\).

$$ E(\eta_{j,i})=\sigma_j E(Z_{j,i})=0, \qquad \operatorname{Var}(\eta_{j,i})=\sigma_j^2\operatorname{Var}(Z_{j,i})=\sigma_j^2. $$

Thus, for a diagonal \(\hat{\Omega}\), independent standard-normal values scaled by the corresponding fitted standard deviations have the fitted marginal distributions. For a non-diagonal \(\hat{\Omega}\), the marginal standard deviations alone are not enough: the joint draw must also reflect the fitted covariances.

Worked Example: Clearance and Volume for One Simulated Subject

Consider a hypothetical one-compartment model with additive random effects on clearance and volume. Suppose \(CL_{\mathrm{pop}}=12\) L/h and \(V_{\mathrm{pop}}=80\) L. The fitted random-effect standard deviations are 3 L/h for clearance and 10 L for volume, and the fitted covariance matrix is diagonal. For one simulated subject, take the standard-normal values \(z_{CL}=1.1\) and \(z_V=-0.6\).

Draw the effects. Scale each standard-normal value by its fitted standard deviation:

$$ \eta_{CL}=3(1.1)=3.3\ \text{L/h}, \qquad \eta_V=10(-0.6)=-6\ \text{L}. $$

Calculate the individual parameters. Under the stated additive mapping:

$$ CL_i=12+3.3=15.3\ \text{L/h}, \qquad V_i=80-6=74\ \text{L}. $$

If the model’s elimination rate parameter is \(k_i=CL_i/V_i\), the corresponding value is \(15.3/74=0.2068\) h\(^{-1}\). The random effects were drawn once for this subject; these parameter values remain the subject’s values across that subject’s simulated records unless the model specifies time-varying parameters.

Worked Example: Calculating Three PK Parameters for Two Subjects

Suppose a hypothetical model has additive random effects on clearance, volume, and absorption rate. Let the population values be \(CL_{\mathrm{pop}}=10\) L/h, \(V_{\mathrm{pop}}=50\) L, and \(k_{a,\mathrm{pop}}=1.20\) h\(^{-1}\). Let the fitted standard deviations be 2 L/h, 8 L, and 0.30 h\(^{-1}\), respectively, with a diagonal covariance matrix. Two simulated subjects have standard-normal component values \((0.5,-0.25,1.0)\) and \((-1.0,0.75,-0.5)\).

For subject A, the random-effect vector is \((2(0.5),8(-0.25),0.30(1.0))=(1,-2,0.30)\), in the corresponding parameter units. Applying the additive mapping gives \(CL_A=10+1=11\) L/h, \(V_A=50-2=48\) L, and \(k_{a,A}=1.20+0.30=1.50\) h\(^{-1}\).

For subject B, the vector is \((2(-1.0),8(0.75),0.30(-0.5))=(-2,6,-0.15)\). Therefore, \(CL_B=10-2=8\) L/h, \(V_B=50+6=56\) L, and \(k_{a,B}=1.20-0.15=1.05\) h\(^{-1}\).

Each subject has one complete vector and one corresponding set of individual parameters. The components are not separate simulated subjects, and the three components should not be reassigned independently after the vectors have been formed.

Assumptions, Checks, and Failure Modes

Before interpreting simulated individual parameters, check that the calculation matches the model being simulated. At minimum, identify the random-effects distribution, the fitted covariance matrix, the ordering and meaning of its components, and the mapping from random effects to PK parameters. The covariates and population parameter estimates should also be those intended for the simulation. A numerical draw can be calculated correctly and still be inappropriate if any of these inputs do not match the fitted model.

  • Check dimensions and units. A random effect added to clearance must be on a compatible scale and in units consistent with clearance. A mismatch, such as adding a volume-scale effect to clearance, signals an indexing or model-mapping error.
  • Check the joint distribution. If \(\hat{\Omega}\) is not diagonal, independently sampling components ignores fitted covariance. That changes which combinations of random effects occur and how frequently they occur.
  • Check resulting parameter values. Look for negative or otherwise inadmissible values, extreme magnitudes, and combinations that are incompatible with the scientific model. These checks evaluate the implications of the fitted distribution and transformation; they do not justify silently editing simulated values.
  • Check what is held fixed. Drawing from \(N(\mathbf{0},\hat{\Omega})\) treats the fitted distribution as known for this calculation. It does not, by itself, draw new fixed-effect estimates or account for uncertainty in the estimated covariance matrix.
  • Check the subject indexing. A subject-level random-effect draw is shared across that subject’s records. Redrawing it at every observation would simulate a different model, not repeated observations on the same individual.

A frequent error is to use a subject’s estimated random effects as if they were fresh draws from the fitted population distribution. Conditional estimates are informed by that subject’s data and are generally not interchangeable with unconditional draws for new subjects. Another error is to draw each component independently merely because each has a reported standard deviation. Independence is a property of the specified joint distribution, not a consequence of writing down marginal standard deviations.

Worked Example: Recognizing an Inadmissible Additive Draw

Suppose a hypothetical model uses \(CL_i=CL_{\mathrm{pop}}+\eta_{CL,i}\), with \(CL_{\mathrm{pop}}=4\) L/h and \(\eta_{CL,i}\sim N(0,3^2)\) in units of L/h. A simulated standard-normal value is \(z=-1.8\).

The random-effect draw is \(\eta_{CL,i}=3(-1.8)=-5.4\) L/h. The resulting clearance is \(CL_i=4+(-5.4)=-1.4\) L/h. The arithmetic is consistent with the stated additive model, but negative clearance is not a plausible PK parameter.

This draw exposes a limitation of the stated combination of an unbounded normal random effect and an additive parameterization. It should not be silently replaced by zero or repeatedly redrawn until a positive value appears: either action changes the simulated distribution. The appropriate response is to verify that the fitted model and parameterization were specified correctly and decide whether that model is suitable for the intended simulation. Any alternative parameterization must be supported by the model being used, not improvised after seeing an inconvenient draw.

What These Draws Do—and Do Not—Represent

Drawing random effects is one way to generate heterogeneity among individuals while holding the fitted population distribution fixed. It differs from using only population-typical values, which yields no between-subject variation in the parameters. It also differs from using conditional individual estimates, which are tied to observed subjects and their data. For a new-subject simulation, a population draw is the relevant choice when the goal is to represent the model’s between-subject variation.

These draws do not automatically include residual variability in measured concentrations, uncertainty in the fitted fixed effects, or uncertainty in \(\hat{\Omega}\). Those are distinct sources of variation and require additional modeling or simulation choices. Nor does a random-effects draw guarantee that the fitted model is adequate: poor fit, weakly estimated variability, an unsuitable distributional assumption, or an implausible parameter mapping can all produce misleading simulations.

The central practical rule is to draw at the level and on the scale specified by the fitted model, preserve the meaning of each vector component, and apply the model’s parameter mapping without alteration. Then inspect whether the resulting individual PK parameters are coherent with the assumptions that generated them.

Check Your Understanding

Answer each question using the stated model assumptions. Full solutions follow the questions.

  1. A model has additive clearance \(CL_i=CL_{\mathrm{pop}}+\eta_{CL,i}\), with \(CL_{\mathrm{pop}}=9\) L/h and \(\eta_{CL,i}\sim N(0,2^2)\). If \(z=0.75\), calculate the random effect and individual clearance.
  2. Why is a population random-effect draw not the same quantity as a conditional estimate for a subject with observed concentrations?
  3. A model has two random effects with nonzero fitted covariance. What is wrong with independently drawing both components using their marginal standard deviations?
  4. A subject has repeated concentration records. Under a model with subject-level random effects, should a new random-effect vector be drawn for each record? Explain.

Solutions. (1) The draw is \(\eta_{CL,i}=2(0.75)=1.5\) L/h, so \(CL_i=9+1.5=10.5\) L/h. (2) A population draw comes from the fitted distribution for a simulated individual; a conditional estimate uses that observed subject’s concentration data and is not an unconditional population draw. (3) Independent component draws impose zero covariance, so they fail to reproduce the fitted joint distribution when its covariance is nonzero. (4) No. Draw one subject-level vector and use it for that subject’s records; redrawing per record would replace persistent between-subject variation with a different model structure.