Tutorials › Quantitative Systems Pharmacology (QSP) › Worked Example: Uncertainty in HbA1c Response

Propagating Uncertainty to Clinical Predictions · Tutorial 743 of 799

Worked Example: Uncertainty in HbA1c Response

Propagate parameter and patient uncertainty through a hypothetical HbA1c treatment simulation to summarize response predictions and estimate the probability of reaching a clinical target.

Advanced 10 min read

What You'll Learn

  • Distinguish the predictive distribution for an individual patient from uncertainty in a population-average response.
  • Combine joint parameter draws and patient-level variability in a treatment simulation.
  • Estimate an HbA1c target-attainment probability from simulated outcomes.
  • Separate predictive spread from Monte Carlo error in the estimated probability.
  • Diagnose errors caused by broken parameter dependence, inappropriate plug-in predictions, or mismatched endpoints.

From Model Uncertainty to an HbA1c Prediction

A treatment simulation does not produce one certain HbA1c response. Even for a fixed regimen and a defined patient group, uncertainty in glucose-insulin model parameters changes the predicted response. Patients also differ in characteristics and physiology that affect their individual trajectories. The practical question is therefore not only “What is the predicted response?” but also “How widely might responses vary, and what fraction of patients might reach a specified target?”

This tutorial follows a hypothetical 24-week treatment simulation. HbA1c is expressed as a percentage, but changes in HbA1c are reported in percentage points: a change from 8.2% to 7.0% is a decrease of 1.2 percentage points. A target-attainment probability is meaningful only after specifying the treatment regimen, time point, target, patient population, and uncertainty sources included.

Definition: Let \(A_0\) be baseline HbA1c and \(A_T\) be HbA1c at the prediction time \(T\). Define the change as \(\Delta A=A_T-A_0\), in percentage points. A negative value is a decrease. For a target \(A^*\), target attainment is the event \(A_T\leq A^*\), or equivalently \(A_0+\Delta A\leq A^*\). The predictive distribution describes possible outcomes for patients under the stated model, population, and treatment scenario, accounting for the uncertainty sources included in the simulation.

Write \(\theta\) for uncertain glucose-insulin model parameters and \(\eta\) for patient-level characteristics or random effects. With data \(D\) used to estimate parameters, a predictive distribution for a new patient can be represented as

$$ p(\Delta A\mid D,\text{regimen},x) = \int\!\!\int p(\Delta A\mid\theta,\eta,x,\text{regimen})\, p(\eta\mid x)\,p(\theta\mid D)\,d\eta\,d\theta . $$

Here \(x\) denotes the patient population or covariates being predicted. The expression says to average conditional predictions over parameter uncertainty and the specified patient distribution. If the model includes residual variability in the outcome, that variability belongs in the conditional outcome distribution as well. Include it only when the prediction concerns an outcome that is meant to contain that variation; do not add it again if the simulation output already represents it.

In computation, draw \(\theta_m\) from the joint parameter uncertainty distribution and draw \(\eta_{mi}\) from the patient distribution. Simulate the treatment response for each combination. Preserving the joint parameter distribution matters: parameter estimates may be correlated, and independent marginal draws can create combinations that are implausible under the fitted model. If baseline HbA1c varies across patients, simulate baseline and response consistently, then apply the target to \(A_0+\Delta A\). A response change alone does not determine target attainment when baseline varies.

Why the Predictive Spread Has Multiple Sources

Even without residual outcome noise, a simulated response varies because both \(\theta\) and \(\eta\) vary. The following variance identity helps explain the roles of these sources. Conditional on \(\theta\), average over patient variability; then average the conditional variance and the variation in the conditional mean over parameter uncertainty:

$$ \operatorname{Var}(\Delta A\mid D) = E_{\theta\mid D}\!\left[\operatorname{Var}(\Delta A\mid\theta,D)\right] + \operatorname{Var}_{\theta\mid D}\!\left[E(\Delta A\mid\theta,D)\right]. $$

This follows by adding and subtracting \(E(\Delta A\mid\theta,D)\) inside \(\Delta A-E(\Delta A\mid D)\). The cross-product has expectation zero conditional on \(\theta\), because \(E[\Delta A-E(\Delta A\mid\theta,D)\mid\theta,D]=0\). The first term captures variation remaining among patients at a given parameter draw; the second captures variation in the conditional mean across parameter draws. With additional random components, the conditional variance also includes their contribution and any dependence specified by the model.

The identity explains why a prediction at the mean parameter values is not generally a substitute for a predictive distribution. A nonlinear QSP model may respond differently at the average parameter vector than the average of responses over parameter draws. Further, a single “typical patient” does not represent the distribution of individual outcomes. The simulation should run the model for draws from the intended joint distributions.

Worked Example: A Small Predictive Ensemble

Hypothetical data. Suppose a teaching ensemble contains 12 equally weighted simulated 24-week HbA1c changes, in percentage points. Each output comes from a treatment simulation using a parameter draw and a patient draw. The sorted changes are \(-1.8,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,-1.0,-0.9,-0.8,-0.6,-0.4\). Baseline HbA1c is fixed at 8.2% for this example, and the target is \(A_T\leq7.0\%\).

The ensemble mean change is

$$ \overline{\Delta A} = \frac{-1.8-1.6-1.5-1.4-1.3-1.2-1.1-1.0-0.9-0.8-0.6-0.4}{12} = \frac{-13.6}{12} = -1.133\text{ percentage points}. $$

For this equally weighted ensemble, the standard deviation describing its spread uses divisor 12. The sum of squared changes is \(17.32\), so

$$ s_{\text{ensemble}} = \sqrt{\frac{17.32}{12}-(-1.1333)^2} = \sqrt{0.1589} = 0.3986\text{ percentage points}. $$

The target requires \(8.2+\Delta A\leq7.0\), or \(\Delta A\leq-1.2\) percentage points. Six of the 12 simulated outcomes meet that condition, so the ensemble estimate of target attainment is \(6/12=0.50\), or 50%. This is an illustration of the calculation, not a precise estimate: twelve draws are far too few to characterize a clinical predictive distribution reliably. The standard deviation describes predictive spread in this ensemble; it is not the standard error of the estimated mean or target probability.

Estimating Target Attainment and Its Simulation Error

For \(N\) simulated patients, define \(I_i=1\) when patient \(i\) meets the target and \(I_i=0\) otherwise. The Monte Carlo estimate of target probability is the fraction of simulated outcomes meeting the target. If the simulated outcomes are independent draws from the intended predictive distribution, the approximate Monte Carlo standard error is the binomial standard error shown below.

$$ \hat{q}=\frac{1}{N}\sum_{i=1}^{N}I_i, \qquad SE_{\mathrm{MC}}(\hat{q}) \approx \sqrt{\frac{\hat{q}(1-\hat{q})}{N}}. $$

This standard error concerns finite simulation size: it measures how much the estimated probability would vary across repeated Monte Carlo runs of size \(N\). It does not measure the predictive variation in individual HbA1c responses. If draws are dependent—for example, because patients share an outer parameter draw—the independent-binomial formula may not apply directly. Use the simulation design, such as independent replicate runs or appropriate grouping by parameter draw, to assess numerical stability.

Worked Example: Checking Monte Carlo Precision

Hypothetical simulation. A simulation generates 2,000 independent patient outcomes from the intended predictive distribution. Of these, 82 meet the HbA1c target. The estimated target probability is

$$ \hat{q}=\frac{82}{2000}=0.0410=4.10\%. $$

The approximate Monte Carlo standard error is

$$ SE_{\mathrm{MC}}(\hat{q}) = \sqrt{\frac{0.0410(1-0.0410)}{2000}} = \sqrt{0.00001966} = 0.004434. $$

A rough 95% Monte Carlo interval is \(0.0410\pm1.96(0.004434)\), or about 3.23% to 4.97%. This interval expresses simulation error in estimating the model-implied target probability; it is not an interval containing 95% of individual patients, nor does it include uncertainty omitted from the model. For a small target probability, simply increasing \(N\) may be necessary to obtain adequate precision, especially if the estimate is to be reported with narrow rounding.

Joint Parameter Uncertainty: A Numerical Check

The dependence among uncertain parameters can substantially change response spread. This is especially important when parameters jointly control processes such as glucose handling and insulin action. The next calculation uses a deliberately simplified linear representation of a QSP simulation output to isolate that point. It is not a replacement for running a nonlinear mechanistic model.

Worked Example: The Effect of Correlated Parameter Draws

Hypothetical model approximation. Suppose the simulated change, in percentage points, is approximated by

$$ \Delta A=-0.90+0.40Z_1-0.30Z_2+0.25Z_{\eta}, $$

where \(Z_1\) and \(Z_2\) are standardized parameter deviations with correlation 0.60, and \(Z_{\eta}\) is an independent standardized patient effect. Assume all three have mean zero and variance one, and baseline HbA1c is 8.2%. The mean predicted change is \(-0.90\) percentage points. The variance contributed by the two parameter terms is

$$ (0.40)^2+( -0.30)^2+ 2(0.40)(-0.30)(0.60) = 0.160+0.090-0.144 = 0.106. $$

The patient-effect variance is \((0.25)^2=0.0625\), so total variance is \(0.1685\) and the standard deviation is \(\sqrt{0.1685}=0.4105\) percentage points. If the two parameter draws were incorrectly treated as independent, the variance would instead be \(0.160+0.090+0.0625=0.3125\), giving a standard deviation of \(0.5590\) percentage points.

For illustration, if the response distribution is approximated as normal, the target \(A_T\leq7.0\%\) requires \(\Delta A\leq-1.2\). Under the correlated calculation, the standardized threshold is \((-1.2-(-0.90))/0.4105=-0.731\), giving a target probability of approximately 23.2%. Under the incorrect independence calculation, the standardized threshold is \(-0.537\), giving approximately 29.6%. The difference arises from the assumed parameter dependence, not from a change in the target. For a nonlinear QSP model, estimate the probability from joint simulations rather than relying on this normal approximation unless its adequacy has been checked.

Diagnostics, Alternatives, and Limitations

Before interpreting a simulated HbA1c distribution, verify that it corresponds to the intended prediction. Check the regimen, simulation time, baseline definition, patient population, and target inequality. Confirm that parameter draws preserve estimated dependence and plausible constraints, and that patient draws reflect the covariates or subgroup distribution of interest. Inspect the simulated response distribution for implausible values, unexpected truncation, excessive concentration at a boundary, or a shape that makes a reported mean and standard deviation unrepresentative. A target probability can look stable while the distribution’s tails remain poorly sampled, so inspect the number of target events and repeat the simulation with larger or independent runs when precision is inadequate.

There are several common alternatives, each answering a different question. A plug-in simulation at estimated mean parameters gives a conditional prediction for one parameter vector; it omits parameter uncertainty and may not equal the predictive mean in a nonlinear model. A delta-method approximation uses local derivatives to approximate uncertainty near a reference parameter vector; it can be computationally efficient but may be inaccurate for strongly nonlinear responses or threshold probabilities. A full Monte Carlo simulation can represent nonlinearities, joint parameter dependence, and patient heterogeneity, but it requires adequate sampling and sound inputs. A population-average response is not the same as an individual predictive distribution, and a probability for an individual target is not automatically a trial-level probability.

The output is conditional on model structure, estimated parameter uncertainty, patient distribution, and simulation assumptions. It does not account for an uncertainty source that was not represented. In particular, a very precise Monte Carlo estimate cannot repair a misspecified model or an unrepresentative patient population. Report what the simulation includes, the time point and target definition, the number and structure of draws, and the Monte Carlo precision. Interpret the result as a model-based prediction for the stated scenario, not as a guarantee about any individual patient.

Common Pitfalls

  • Using independent parameter draws by default. This can destroy dependence in the fitted parameter distribution and distort response spread. Draw from the joint distribution or use a sampling method that preserves its dependence.
  • Reporting the response mean as the target probability. A mean change does not say how many patients meet a threshold. Apply the target condition to each simulated outcome and count the qualifying outcomes.
  • Confusing predictive spread with Monte Carlo error. The response standard deviation describes variation across predicted outcomes; the Monte Carlo standard error describes numerical uncertainty in an estimated summary such as target probability.
  • Applying a change threshold without checking baseline. When baseline HbA1c varies, target attainment depends on the joint values of baseline and change. Simulate or otherwise account for both.
  • Calling a model-based probability a clinical guarantee. It is conditional on the model and represented uncertainties, not a promise that a specified fraction of future patients will respond.
Key takeaway: Simulate joint parameter uncertainty and patient variability through the treatment model, then calculate HbA1c summaries and target attainment from the resulting outcomes. Keep predictive variation distinct from Monte Carlo error, and state the population, endpoint, time point, and assumptions behind every probability.

Check Your Understanding

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

  1. A patient has baseline HbA1c 8.4%. What change is required to meet a target of 7.0% or lower?
  2. In 1,000 independent simulated patients, 120 meet the target. Calculate the estimated probability and approximate Monte Carlo standard error.
  3. Why can simulating once at the mean parameter values fail to give the predictive mean response?
  4. A model predicts change in HbA1c, but baseline HbA1c varies across the population. What additional information is needed to estimate target attainment correctly?

Solutions. (1) The condition is \(8.4+\Delta A\leq7.0\), so \(\Delta A\leq-1.4\) percentage points. (2) The estimate is \(120/1000=0.120\), or 12.0%. Its approximate Monte Carlo standard error is \(\sqrt{0.12(0.88)/1000}=\sqrt{0.0001056}=0.0103\), or 1.03 percentage points. (3) A nonlinear model generally satisfies \(E[f(\theta)]\ne f(E[\theta])\), and one parameter vector also omits parameter-induced predictive spread. (4) Use baseline and change together, preserving any dependence specified by the model, and count outcomes for which \(A_0+\Delta A\leq A^*\).

Clinical Biostats