Why the Source of Random Effects Matters
A fitted nonlinear mixed-effects model can provide a subject-specific empirical Bayes estimate (EBE) for each individual in the fitting data. These estimates are useful summaries of what the data suggest about those individuals. But they are not, in general, a sample of independent draws from the population random-effects distribution. Treating them as such can make a simulated population appear less variable than the model says it should be.
The distinction is important when simulating new subjects. Their random effects should represent variation in the model’s target population, rather than the amount of variation visible in conditional estimates from a particular data set. The latter depends both on the population distribution and on how informative the observed data are about each person.
For example, a model might define individual clearance as \(CL_i = \theta_{CL}\exp(\eta_{CL,i})\). Here \(\theta_{CL}\) is the typical clearance and \(\eta_{CL,i}\) is the subject’s random effect on the log scale. The population model describes how \(\eta_{CL,i}\) varies among subjects before observing their individual concentration data. An EBE instead uses those data to estimate the particular subject’s effect.
A Simple Derivation of Shrinkage
The source of the difference can be seen in a simple Gaussian random-intercept model. Assume that subject \(i\) has \(m\) measurements, \(Y_{ij} = \mu + \eta_i + \epsilon_{ij}\), with \(\eta_i \sim N(0,\omega^2)\) and independent \(\epsilon_{ij} \sim N(0,\sigma^2)\). Assume random effects and residual errors are independent, and that \(\mu\), \(\omega^2\), and \(\sigma^2\) are known. These assumptions make the calculation exact; nonlinear models usually have a more complicated conditional distribution, but the distinction between a population draw and a data-conditioned estimate remains.
Write \(\bar{Y}_i\) for subject \(i\)’s mean measurement. Conditional on \(\eta_i\), it has mean \(\mu+\eta_i\) and variance \(\sigma^2/m\). Normal conjugacy gives the conditional mean, which is also the conditional mode:
Because \(0<\lambda<1\), the estimate is pulled toward the population mean of the random effect, zero. The pull is stronger when the subject has fewer measurements or more residual noise, and weaker when the data are more informative. In this setting, the conditional variance is \(Var(\eta_i\mid\bar{Y}_i)=\omega^2(\sigma^2/m)/(\omega^2+\sigma^2/m)\).
The variance of these estimates across hypothetical subjects and data sets is not \(\omega^2\). Since \(\bar{Y}_i-\mu\) has variance \(\omega^2+\sigma^2/m\),
The reduction is not a contradiction: the EBE is an estimate, not the underlying random effect. In this model, the law of total variance separates the population variation into variation among conditional means and average conditional uncertainty: \(Var(\eta_i)=Var(E[\eta_i\mid\bar{Y}_i])+E[Var(\eta_i\mid\bar{Y}_i)]\). Thus the variation among the estimates omits the second component. Resampling only the estimates does not restore that omitted uncertainty.
Worked Example: Quantifying the Loss of Variability
Suppose a hypothetical study is described by the Gaussian model above, with between-subject variance \(\omega^2=0.64\) on the random-effect scale, residual variance \(\sigma^2=1.00\), and \(m=4\) measurements per subject. Treat these variance components as known for this calculation.
The variance of a subject’s mean residual error is \(\sigma^2/m=1.00/4=0.25\). The shrinkage factor is therefore \(\lambda=0.64/(0.64+0.25)=0.7191\). An observed subject mean 0.50 units above \(\mu\) gives the conditional estimate \(\widehat{\eta}_i=0.7191(0.50)=0.3596\), rather than 0.50.
Across subjects and repeated data sets, the variance of the estimates is \(0.64^2/(0.64+0.25)=0.4602\), with standard deviation \(\sqrt{0.4602}=0.6784\). The population random effects have standard deviation \(\sqrt{0.64}=0.8000\). Resampling estimates as if they were population effects would therefore reproduce a narrower distribution in this idealized setting.
The conditional variance for a subject is \(0.64(0.25)/0.89=0.1798\). The variance decomposition checks: \(0.4602+0.1798=0.6400\). The missing spread is conditional uncertainty, not a reason to inflate the EBE values by an arbitrary factor.
Simulating New Subjects From the Fitted Population
For a new subject in a population simulation, draw a random-effects vector from the fitted population distribution. If the fitted model specifies \(\eta_i\sim N(0,\Omega)\), use \(\widehat{\Omega}\) as the covariance matrix when simulating conditional on the fitted model. Then map the simulated random effects through the model’s individual-parameter relationships. For example, if \(CL_i=\theta_{CL}\exp(\eta_{CL,i})\), calculate clearance using the newly simulated \(\eta_{CL,i}\), not a resampled EBE from the fitting data.
When multiple random effects are modeled, their covariance matters. Simulating each effect independently would be wrong if the fitted \(\Omega\) has nonzero off-diagonal elements. A standard method is to factor \(\widehat{\Omega}=LL^\mathsf{T}\), generate independent standard-normal components \(z\), and set \(\eta=Lz\). This produces a mean-zero normal vector with covariance \(\widehat{\Omega}\).
Worked Example: Drawing Correlated Effects for a New Subject
Consider a hypothetical fitted model with random effects \(\eta_{CL}\) and \(\eta_V\), both on log scales, and estimated covariance matrix \(\widehat{\Omega}=\begin{pmatrix}0.25&0.12\\0.12&0.16\end{pmatrix}\). A valid lower-triangular factor is \(L=\begin{pmatrix}0.50&0\\0.24&0.32\end{pmatrix}\), since \(LL^\mathsf{T}=\widehat{\Omega}\). For one simulated subject, suppose the standard-normal draw is \(z=(1.00,-0.50)^\mathsf{T}\).
The simulated effects are \(\eta=Lz=(0.50,\;0.24-0.16)^\mathsf{T}=(0.50,0.08)^\mathsf{T}\). If the typical values are \(\theta_{CL}=5.00\) L/h and \(\theta_V=40.0\) L, then \(CL_i=5.00\exp(0.50)=8.244\) L/h and \(V_i=40.0\exp(0.08)=43.33\) L.
This is a population draw under the fitted random-effects distribution. The positive covariance has been retained through the shared multivariate draw. It is not a claim about an observed subject’s most likely effects, and it is not obtained by selecting a row of EBEs.
Choosing the Right Quantity for the Simulation
The correct source depends on the simulation question. For new individuals from a target population, use the fitted random-effects distribution, along with the covariate distribution and dosing conditions appropriate to that target. For predictions about a particular observed individual, the individual’s data are relevant: conditional estimates or draws from that individual’s conditional distribution may be appropriate. Those are different targets. Using a conditional estimate to represent a new person confuses what is known about an existing subject with how much subjects vary in the population.
This tutorial concerns random-effect variation conditional on fitted population parameters. If the simulation also needs to reflect uncertainty in fitted parameters, that is a separate layer of simulation. Keep the target clear: a draw of \(\eta_i\) represents between-subject variation under a parameter set; it does not by itself represent uncertainty about that parameter set.
Decide whether the target is new members of a population or predictions for individuals whose data were already observed.
Use the fitted distribution, including its covariance structure, and draw a fresh vector for each new subject.
Apply the model’s transformations and covariate relationships to each simulated effect vector.
Compare simulated effects and individual parameters with the fitted population model on the appropriate scales.
Diagnostics, Alternatives, and Limitations
A practical diagnostic is to compare the spread of the EBEs with the fitted population spread, while remembering that the comparison is scale- and model-dependent. Markedly narrower EBE distributions are expected when individual data are weakly informative. Also inspect whether estimates cluster near zero, whether the apparent spread differs between subjects with sparse and rich sampling, and whether the empirical covariance of the EBEs is smaller than the corresponding fitted covariance. These patterns are warnings against treating the EBE table as a population sample; they are not, by themselves, proof that the fitted model is adequate.
The Gaussian derivation assumes known parameters, balanced measurement counts, a linear random-intercept model, and normal errors. In nonlinear models, EBEs may be conditional modes rather than means, and shrinkage can vary across random effects and subjects. Finite-sample estimates, model misspecification, or optimization problems can also make an empirical EBE distribution behave irregularly. Therefore, the exact variance calculation above is an illustration, not a universal correction formula. The robust principle is to simulate new effects from the model’s fitted population distribution when the goal is population simulation.
| Approach | What it represents | Use for new population subjects? |
|---|---|---|
| Resample EBEs | Conditional estimates shaped by each observed subject’s data | Generally no; their spread can be too small |
| Draw from \(N(0,\widehat{\Omega})\) | Between-subject effects under the fitted population model | Yes, when this is the fitted random-effects distribution |
| Draw conditionally for an observed subject | Uncertainty about that subject’s effect given their data | No; it targets that observed subject, not a new population member |
A common mistake is to say, “There is one EBE per subject, so these estimates are the observed random-effects sample; resampling them will preserve the population variability.” The correction is that each estimate has been pulled toward the population distribution’s center according to the information in that subject’s data. Resampling preserves the spread of the estimates, not the spread of the latent effects. Conversely, drawing from \(\widehat{\Omega}\) is not a way to reproduce subject-specific knowledge from existing data; it is the appropriate operation for generating new subjects under the fitted population model.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In the Gaussian random-intercept model, what happens to \(\lambda\) when the number of measurements \(m\) increases, with the variance components fixed?
- For the numerical example with \(\omega^2=0.64\), \(\sigma^2=1.00\), and \(m=4\), what is the variance of the EBE across subjects and data sets?
- Why should correlated random effects not be simulated as independent normal variables when the fitted covariance is non-diagonal?
- A researcher wants predictions conditional on one well-observed patient’s data. Should they use a fresh population draw or a conditional distribution for that patient? Explain the distinction.
Solutions. (1) Since \(\lambda=\omega^2/(\omega^2+\sigma^2/m)\), increasing \(m\) decreases \(\sigma^2/m\) and increases \(\lambda\) toward 1, so the data-conditioned estimate is less strongly shrunk. (2) The variance is \(0.64^2/(0.64+1.00/4)=0.4602\), which is less than the population variance \(0.64\). (3) Independent draws have zero covariance and therefore do not reproduce the fitted joint distribution; use a multivariate draw with covariance \(\widehat{\Omega}\). (4) Use the patient’s conditional distribution, because the target is uncertainty about an already observed individual given their data. A fresh population draw instead represents a new individual before conditioning on that patient’s observations.