Why Draw the Variance Component?
A fitted NLME model estimates both population parameters and the amount of between-subject variation around them. A simulation that holds an estimated random-effect variance fixed can generate different subjects, but it treats the estimated degree of heterogeneity as known. That may be reasonable when the goal is explicitly conditional on the fitted variance. It does not, however, show how uncertainty in that estimate affects simulated outcomes.
These are two distinct sources of variation. Random-effect variation describes how subjects differ under a specified model. Variance-component uncertainty describes uncertainty about the model's estimate of how much subjects differ. Propagating both requires an outer draw of the variance component and, within that draw, a subject-level random effect.
The variance component is a model parameter, not an individual subject's random effect. For a lognormal random-effects model, for example, a clearance for subject \(i\) may be written \(CL_i=CL_{\mathrm{pop}}\exp(\eta_i)\), where \(\eta_i\) is a subject effect and \(\omega^2\) is its population variance. Drawing \(\eta_i\) repeatedly with \(\omega^2\) fixed explores subject variation conditional on the fitted variance; drawing \(\omega^2\) as well also represents uncertainty about that variance estimate.
A Positive-Scale Draw for a Variance
Variance components cannot be negative, and their sampling distributions can be asymmetric, especially when the estimate is imprecise or near zero. A common approximation is to work with the log variance \(\lambda=\log(\omega^2)\). If the fitted value is \(\hat{\omega}^2>0\), set \(\hat{\lambda}=\log(\hat{\omega}^2)\), then draw \(\lambda^{(r)}\sim N(\hat{\lambda},SE_{\hat{\lambda}}^2)\) and transform back: \(\omega^{2(r)}=\exp(\lambda^{(r)})\). The exponential guarantees a positive draw.
This is an approximate uncertainty distribution based on the estimated standard error of the log variance. In a frequentist simulation, it is a normal approximation to estimation uncertainty; it should not be described as a posterior distribution. A Bayesian analysis instead uses posterior draws of the variance component. If the available standard error is on the variance scale, a first-order delta-method approximation is \(SE_{\hat{\lambda}}\approx SE_{\hat{\omega}^2}/\hat{\omega}^2\), provided the estimate is positive and the approximation is suitable.
The approximation assumes that the log-variance estimator is reasonably represented by a normal distribution and that its estimated uncertainty is informative. It can be unreliable near a boundary estimate of zero, where the log is undefined, or when the likelihood is highly asymmetric. In those cases, a suitable bootstrap or Bayesian analysis may better represent uncertainty, subject to the assumptions of that method.
Worked Example: Drawing a Positive Variance and a Subject Effect
Suppose a hypothetical model estimates a clearance random-effect variance of \(\hat{\omega}^2=0.25\), with \(SE_{\hat{\lambda}}=0.40\) on the log-variance scale. For one illustrative outer draw, take \(Z_r=-1.00\). Conditional on that variance draw, use a subject-level standard normal draw \(Z_i=0.800\). Let \(CL_{\mathrm{pop}}=5.00\) L/h.
First draw the log variance: \(\hat{\lambda}=\log(0.25)=-1.38629\), so \(\lambda^{(r)}=-1.38629+(0.40)(-1.00)=-1.78629\).
Transform to the variance scale: \(\omega^{2(r)}=\exp(-1.78629)=0.1675800\), which rounds to \(0.1676\). Its standard deviation is \(\sqrt{0.1675800}=0.4094\).
The subject effect conditional on this variance draw is \(\eta_i^{(r)}=\sqrt{0.1675800}(0.800)=0.3275\), using unrounded intermediate values. Thus \(CL_i^{(r)}=5.00\exp(0.3275)\approx6.937\) L/h. This is one hypothetical simulated value, not an estimate of an individual's actual clearance. The outer draw changed the variance used to generate the subject effect.
What the Nested Simulation Represents
The outer and inner steps answer different questions. The outer draw represents uncertainty in the fitted variance component. The inner draw represents a new subject's random effect conditional on the selected variance. The model's structural and residual components can then be used to produce observations, as appropriate to the simulation objective.
For each replicate, draw \(\lambda^{(r)}\) from the specified uncertainty approximation and set \(\omega^{2(r)}=\exp(\lambda^{(r)})\).
For each new subject, draw \(\eta_i^{(r)}\sim N(0,\omega^{2(r)})\), or use the model's stated random-effect distribution.
Insert the drawn parameters and subject effects into the NLME structural model, then add residual error only if simulated observations are required.
Variation across replicates now reflects both variance-estimation uncertainty and subject-level variation, along with any other sources deliberately simulated.
This interpretation depends on the model assumptions: the random effect has the stated conditional distribution and mean, the variance draw is a suitable representation of estimation uncertainty, and the simulated subjects are generated according to the intended design. The outer draw is shared for the subjects in a replicate when the replicate represents one plausible fitted parameter set; subject effects are then drawn conditional on that shared parameter value.
Worked Example: How Variance Uncertainty Changes a Moment
Consider a hypothetical random effect with \(\eta\mid V\sim N(0,V)\), where \(V=\omega^2\). Suppose the uncertainty approximation is \(\lambda=\log V\sim N(\log(0.09),0.50^2)\). Compare the expected fourth moment when variance uncertainty is propagated with the moment obtained by fixing \(V\) at \(0.09\).
For a zero-mean normal variable with variance \(V\), \(E(\eta^4\mid V)=3V^2\). Because \(V=\exp(\lambda)\) and \(\lambda\) is normal, the lognormal moment formula gives \(E(V^2)=\exp(2\log(0.09)+2(0.50^2))\). Therefore \(E(V^2)=0.09^2\exp(0.50)=0.0133547\), and \(E(\eta^4)=3(0.0133547)=0.0400638\), or approximately \(0.04006\).
With the variance fixed at \(0.09\), the corresponding fourth moment is \(3(0.09^2)=3(0.0081)=0.02430\). The larger moment under variance uncertainty follows from averaging \(V^2\), not merely from substituting the average variance into \(3V^2\). Indeed, \(E(V)=0.09\exp(0.125)=0.10198\), while \(E(V^2)=0.0133547\). This illustrates how uncertainty in a variance can change the distribution of simulated subject effects, particularly its tail behavior.
Fixed-Variance and Uncertainty-Propagating Simulations
Neither approach is universally preferable. The choice depends on the estimand and the question. A fixed-variance simulation is conditional on the fitted variance estimate and may be useful for generating variability under one selected fitted model. An uncertainty-propagating simulation represents a range of plausible variance values and is relevant when conclusions should account for uncertainty in that fitted component.
| Simulation choice | What varies between replicates? | Interpretation |
|---|---|---|
| Fix \(\omega^2=\hat{\omega}^2\) | Subject effects and any other deliberately simulated quantities | Outcomes conditional on the estimated variance component |
| Draw \(\omega^{2(r)}\) | The variance component, then subject effects conditional on it | Outcomes that also reflect uncertainty in the variance estimate |
| Use bootstrap or posterior parameter draws | As represented by the resampled fits or posterior draws | Uncertainty represented by that method, subject to its assumptions |
Bootstrap and Bayesian draws are alternatives to a simple normal approximation when their assumptions and implementation are appropriate. A bootstrap uses repeated resampled data sets and refits the model; a Bayesian analysis uses draws from the posterior distribution. Both can preserve non-normal features better than a log-scale normal approximation, though bootstrap fits may fail and posterior results depend on the model and prior. The relevant question is not just which method produces more spread, but whether its uncertainty representation matches the analysis and target quantity.
Worked Example: Comparing Fixed and Drawn Variance Simulations
Suppose a hypothetical population value is \(\theta_{\mathrm{pop}}=10\) units and \(\hat{\omega}^2=0.16\). On the log-variance scale, use \(SE_{\hat{\lambda}}=0.30\). For a transparent comparison, use the same illustrative subject-level standard normal value \(Z_i=1.20\) under three cases: fixed variance, an outer draw with \(Z_r=-1\), and an outer draw with \(Z_r=1\).
With variance fixed, \(\eta_i=\sqrt{0.16}(1.20)=0.4800\), and \(\theta_i=10\exp(0.4800)\approx16.16\) units.
For the lower outer draw, \(V=0.16\exp(-0.30)=0.11852\), so \(\eta_i=\sqrt{0.11852}(1.20)\approx0.4131\) and \(\theta_i=10\exp(0.4131)\approx15.12\) units.
For the higher outer draw, \(V=0.16\exp(0.30)=0.21599\), so \(\eta_i=\sqrt{0.21599}(1.20)\approx0.5577\) and \(\theta_i=10\exp(0.5577)\approx17.47\) units. These three values isolate the effect of changing the variance while holding the subject-level normal draw fixed. In an actual simulation, subject effects would ordinarily be drawn across subjects and replicates; this calculation is not itself an estimate of the average outcome.
Diagnostics, Limitations, and a Common Mistake
Check the simulated variance draws before interpreting simulated outcomes. They should all be positive, their log-scale mean and spread should agree with the intended approximation, and extreme draws should be examined for whether they produce implausible parameter values or numerical failures. Compare the resulting distribution with the fitted estimate and its reported uncertainty. If the log-scale approximation is poor, a visually smooth simulation does not make it valid.
- Boundary or highly asymmetric estimates: a normal approximation on the log scale may not represent the estimator's behavior well, particularly near zero.
- Dependence on other fitted parameters: drawing each variance independently can be inappropriate if estimation uncertainty associates it with other parameters. Use a suitable joint uncertainty representation when the analysis provides one.
- Unintended conditioning: fixing a variance is not wrong, but it answers a conditional question. State that choice so the simulation's scope is clear.
- Excessive extrapolation: a broad approximate distribution can generate extreme values that make the structural model unstable. Investigate the model and approximation rather than silently discarding inconvenient draws.
A further limitation is that this procedure propagates only the uncertainty represented in the variance draws. It does not repair model misspecification, identify a poorly estimated variance from inadequate data, or automatically incorporate uncertainty in every other model component. The simulation design should make explicit which fitted quantities vary and which are held fixed.
Check Your Understanding
Answer each question, then compare your reasoning with the brief solutions below.
- In a nested simulation, what does the outer variance draw represent, and what does the conditional subject-effect draw represent?
- If \(\hat{\omega}^2=0.04\) and a log-variance draw is \(\lambda^{(r)}=\log(0.04)+0.20\), calculate the variance draw to three significant figures.
- Why does a simulation of many subject effects from a fixed variance not include uncertainty in the fitted variance component?
- Name one situation in which the log-scale normal approximation may be unreliable, and give one possible alternative.
Solutions. (1) The outer draw represents uncertainty in the estimated population variance; the inner draw represents a subject effect conditional on that selected variance. (2) \(\omega^{2(r)}=0.04\exp(0.20)=0.0489\) to three significant figures. (3) Every subject effect is generated using the same \(\hat{\omega}^2\), so the variance parameter never changes across replicates. (4) Near a boundary estimate of zero, the log-scale approximation can fail; a suitable bootstrap or Bayesian posterior draw may be preferable if its assumptions and fit are appropriate.