Why a Simulation Can Contain Several Kinds of Uncertainty
An NLME simulation can produce a wide range of outcomes for more than one reason. A future concentration may differ because the fitted population parameters are uncertain, because a new subject differs from the typical subject, because that subject’s response changes across occasions, or because measured observations include residual error. A finite simulation also estimates its results imperfectly: that is Monte Carlo error, not additional biological or measurement variability.
These sources answer different questions. For example, uncertainty in fitted population parameters concerns what the available data tell us about the model’s population-level quantities. Between-subject variability concerns how individuals differ under the model. Whether a simulated quantity includes residual error depends on whether the target is an underlying model prediction or a future observed concentration. The target and the conditioning choices determine which layers belong in a simulation.
A Layered Model and Its Prediction Targets
For a concentration measured on subject \(i\), occasion \(j\), at time \(t_{ij}\), a schematic NLME observation model is
Here \(D_{ij}\) represents dosing information, \(x_i\) represents subject covariates, \(\theta\) is the vector of population parameters, \(\eta_i\) is a subject-level random effect, \(\kappa_{ij}\) is an occasion-level random effect, and \(\epsilon_{ij}\) is residual error. This is a schematic representation: a particular model may omit one or more random-effect layers, use a different residual model, or include dependence among terms.
The fitted estimate of \(\theta\) is not necessarily known exactly. Parameter uncertainty describes uncertainty about the value of \(\theta\) that is relevant to the population, given the fitted model and available data. It is conceptually distinct from drawing different \(\eta_i\) values for different subjects. Even if \(\theta\) were known, subjects could vary; even if a particular subject’s random effect were known, uncertainty in \(\theta\) could remain.
The simulated quantity also matters. A prediction of the underlying concentration \(f(\cdot)\) does not include residual error. A simulated observation \(Y_{ij}\) does. A prediction for an existing subject may condition on information about that subject, whereas a prediction for a new subject must represent between-subject variability. Conditioning on a specific occasion or averaging over occasions likewise changes which occasion-level variation is relevant.
How the Layers Contribute to Variance
A useful justification for separating the sources is the law of total variance. For any random variable \(Y\) with finite variance and a conditioning variable \(\Theta\),
The first term is variation in the conditional mean as \(\Theta\) varies; the second is the average variation remaining when \(\Theta\) is held fixed. To verify the identity, write \(Y-E[Y]=(Y-E[Y\mid\Theta])+(E[Y\mid\Theta]-E[Y])\), square, and take expectations. The cross-product has expectation zero because \(E[Y-E[Y\mid\Theta]\mid\Theta]=0\). The two squared terms therefore give the conditional-variance term and the variance of the conditional mean, respectively.
Taking \(\Theta=\theta\), where \(\theta\) is treated as uncertain for prediction, gives a parameter-uncertainty contribution and a conditional predictive contribution. That conditional contribution can be split further by conditioning successively on subject and occasion effects. For a single observation with nested random effects and residual error, one such decomposition is
This expression describes a nested conditioning scheme: parameter uncertainty first, then subject effects, occasion effects, and residual error. Each variance term is averaged over the layers on which it depends. The model must specify the relevant distributions and dependencies; the equation does not require that every model contain all four random sources. Nor does it imply that an arbitrary nonlinear model’s total variance equals a sum of four unconditional variances calculated separately. The conditional expectations and averaging in the decomposition matter, especially when layers interact or are dependent.
Worked Example: Naming the Uncertainty in a Concentration Prediction
Consider a hypothetical fitted model used to simulate a concentration for a new subject on a future occasion. Suppose the model has an uncertain fitted population clearance parameter, a subject random effect on clearance, an occasion random effect on absorption, and additive residual error. Identify what each source represents and which sources belong in two different targets.
For the underlying concentration prediction, the model’s prediction is \(f(t,D,x;\theta,\eta,\kappa)\). If the target is a new subject and future occasion, population-parameter uncertainty, between-subject variability, and between-occasion variability can all contribute to the predictive spread. Residual error is not included because the target is the model prediction, not a noisy observation.
For a future observed concentration, the target is \(Y=f(t,D,x;\theta,\eta,\kappa)+\epsilon\). Residual error is included as well. In both cases, the exact contribution depends on the specified fitted model and prediction conditions; merely labelling an output a “prediction” does not determine whether residual error is present.
For an existing subject at a known occasion, the prediction may condition on available subject- or occasion-specific information. It would not automatically represent the full distribution for new subjects and occasions. Thus the same fitted model can yield different predictive distributions for different targets, without any change to its scientific interpretation.
Worked Variance Calculation
In a simple local approximation, the variance contributions can be easy to see numerically. The following calculation is illustrative, not a claim that every NLME model has additive independent layers.
Worked Example: Combining Four Independent Contributions
Suppose a hypothetical concentration prediction, in mg/L, is locally represented as a fixed mean of \(20\) mg/L plus four independent, mean-zero deviations. Let the standard deviations be \(2\) mg/L for parameter uncertainty, \(4\) mg/L for between-subject variability, \(3\) mg/L for between-occasion variability, and \(5\) mg/L for residual error. The target is a future observed concentration, so all four deviations are included.
Because the four deviations are independent and additive, the variance is the sum of their variances:
The resulting standard deviation is \(\sqrt{54}=7.348\) mg/L. Under this illustrative additive, approximately normal model, a central 95% predictive interval would be \(20\pm1.96(7.348)\) mg/L, or approximately \(5.60\) to \(34.4\) mg/L. This describes the model’s distribution of future observations under the stated assumptions; it is not a confidence interval for the population mean.
If the target were the underlying prediction rather than an observed concentration, omit residual error. The variance would then be \(4+16+9=29\ (\mathrm{mg/L})^2\), with standard deviation \(\sqrt{29}=5.385\) mg/L. This difference arises from changing the target, not from a different fitted population model.
The arithmetic above relies on independent additive deviations. In a nonlinear model, effects can interact, and random effects may be correlated. Then this sum of four squared standard deviations is not justified without further assumptions; the conditional variance decomposition is the safer general description.
Monte Carlo Error Is Not Predictive Spread
A simulation uses a finite number of draws to approximate a quantity such as a mean, a predictive probability, or a quantile. Even if the draws correctly represent the desired predictive distribution, the computed summary will vary across repeated simulation runs. For \(M\) independent simulated outcomes with sample standard deviation \(s\), the Monte Carlo standard error of the simulated mean is \(s/\sqrt{M}\). This standard error measures numerical uncertainty in the estimated mean; it is not the predictive standard deviation \(s\) itself.
Worked Example: Estimating Monte Carlo Error for a Mean
Suppose \(M=400\) independent simulated future concentrations have a simulated mean of \(18.6\) mg/L and a sample standard deviation of \(12.0\) mg/L. The Monte Carlo standard error of the mean estimate is
Using a normal approximation for the simulation error, an approximate 95% Monte Carlo interval for the predictive mean is \(18.6\pm1.96(0.600)\) mg/L, or \(17.42\) to \(19.78\) mg/L. This interval quantifies numerical uncertainty in the estimated mean under the independent-draw approximation. It is not a predictive interval for individual future concentrations: the simulated outcomes themselves have standard deviation \(12.0\) mg/L.
If the simulation draws are dependent, for example because a sampling algorithm produces correlated draws, \(s/\sqrt{M}\) is not generally a valid Monte Carlo standard error. The effective amount of independent information is then less than \(M\), and a method that accounts for dependence is needed.
Diagnostics, Alternatives, and Limitations
A useful diagnostic is to state the prediction target in words before interpreting a simulated distribution: a typical subject or a new subject, an underlying prediction or an observed value, a specified occasion or future occasions, and a fixed fitted parameter value or uncertainty about that value. Then check that the simulated components match that target. If a simulated predictive interval is unexpectedly narrow, ask whether a relevant layer was conditioned away or omitted. If it is unexpectedly wide, check whether residual error or a random-effect layer was included when the target did not call for it.
The main alternatives are different conditioning choices, not competing definitions of variability. A simulation conditional on fitted population parameter estimates isolates process variability under those values but does not represent uncertainty about the fitted parameters. A simulation that also represents parameter uncertainty targets a broader distribution that incorporates uncertainty from fitting. Predictions conditional on an existing subject’s information differ from marginal predictions for a new subject. And a distribution for the latent model prediction differs from one for observed data when residual error is added.
These distinctions have limits. A variance decomposition does not establish that the model’s random-effect distributions, residual model, or parameter uncertainty representation are correct. If sources are dependent, their joint structure matters. If outcomes are strongly nonlinear or skewed, a variance summary alone may not describe important features such as tail probabilities. Monte Carlo error also depends on the summary being estimated: the formula for a mean does not directly provide the Monte Carlo error of a quantile or a coverage probability.
- Pitfall: calling all simulation spread “parameter uncertainty.” This is incorrect because new-subject effects, occasion effects, and residual error can widen outcomes even when population parameters are held fixed. Name each source and the conditioning used.
- Pitfall: treating a small Monte Carlo error as a narrow predictive distribution. A precisely estimated mean can coexist with large variation among future observations. Report numerical precision separately from predictive spread.
- Pitfall: adding standard deviations as if they were variances. Under independent additive terms, add variances, then take the square root. If terms are correlated or the model is nonlinear, use the model’s joint structure rather than an unsupported sum.
- Pitfall: including residual error in every prediction. Residual error belongs in a simulated observation, but not automatically in a prediction of the underlying model expectation.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A simulation fixes the fitted population parameters and generates new subjects, but it does not add residual error. Which uncertainty layers are represented, and what is the likely target?
- In the independent additive example, what is the variance if the target is an underlying prediction and residual error is excluded?
- A researcher increases the number of independent simulations from 400 to 1,600. By what factor does the Monte Carlo standard error of a simulated mean change, approximately?
- Why is it generally wrong to add unconditional variances for subject and occasion effects without checking the model structure?
Solutions. (1) Between-subject variability is represented; parameter uncertainty and residual error are not. Because occasion effects were not specified, they are not represented either. The target is a prediction for new subjects conditional on the fixed fitted parameters, rather than a future observation. (2) Excluding residual error gives \(4+16+9=29\ (\mathrm{mg/L})^2\). (3) The Monte Carlo standard error is proportional to \(1/\sqrt{M}\), so multiplying \(M\) by four halves the standard error, assuming independent draws and comparable variability. (4) Subject and occasion effects may be dependent or may interact through a nonlinear prediction function; their marginal variances need not add to the total variance. The model’s conditional structure must be respected.