Tutorials › Nonlinear Mixed-Effects Models (NLME) › Worked VPC for a Two-Compartment Concentration Profile

Visual and Numerical Predictive Checks · Tutorial 604 of 797

Worked VPC for a Two-Compartment Concentration Profile

Work through a two-compartment concentration VPC, from time-bin choices and percentile calculations to interpreting simulation envelopes and diagnosing apparent model misfit.

Intermediate 12 min read

What You'll Learn

  • Define a VPC for concentration-time data and distinguish observed percentiles from simulation-based prediction intervals.
  • Choose time bins that preserve the distribution and time course of a two-compartment profile.
  • Calculate empirical concentration percentiles using an explicit quantile convention.
  • Read prediction envelopes and recognize patterns consistent with distributional departures.
  • Diagnose misleading displays caused by sparse bins, broad bins, or simulation noise.

Why a Two-Compartment VPC Needs Careful Binning

A two-compartment concentration profile can change rapidly after a dose. Following an intravenous bolus, concentrations are often represented by a biexponential curve: an early distribution phase and a slower terminal phase. A useful visual predictive check (VPC) asks whether the observed concentration distribution over time is compatible with concentration-time data simulated from the fitted model. The comparison is distributional: it is not a test of whether one fitted curve passes through every observation.

The time bins are central to the comparison. If a bin combines observations from substantially different times, a wide range of concentrations can arise simply because the profile is changing within that bin. A bin that is too narrow, on the other hand, may contain too few observations for stable percentiles. The aim is to make bins narrow enough to represent comparable parts of the time course, while retaining enough observations for interpretable summaries.

Definition: A VPC compares observed outcome summaries in defined covariate or time bins with the distributions of those same summaries calculated from replicated data simulated under a fitted model. For a concentration-time VPC, the summaries are commonly lower, median, and upper concentration percentiles in each time bin. A prediction interval for a summary is formed from its values across simulated data sets; it is not an interval for an individual concentration.

For an intravenous bolus two-compartment profile, a common structural expression is \(C(t)=A e^{-\alpha t}+B e^{-\beta t}\), where \(C(t)\) is concentration at time \(t\), \(A\) and \(B\) are positive coefficients, and \(\alpha>\beta>0\) are rate constants. The faster exponential usually contributes more to the early decline, while the slower exponential describes the terminal decline. In an NLME model, individual profiles can also vary through subject-specific parameters, and observations vary through the residual-error model. The VPC assesses the combined simulated distribution, not just this typical profile.

Constructing the VPC

Before interpreting a VPC, specify what has been simulated. For a standard predictive check, simulate concentration data under the fitted model using the study's relevant dosing, covariates, observation times, and sampling or missing-record pattern. Include the model's between-subject variability and residual error if the check is intended to represent new observations from the population. If parameters are held at their fitted estimates, the check does not include uncertainty in those estimates; that distinction should be made explicit.

For each time bin, calculate the chosen concentration percentiles in the observed data. Repeat the same calculation separately for every simulated data set. If there are \(R\) simulated data sets and \(Q_{r,b,p}\) is the \(p\)th percentile for replicate \(r\), bin \(b\), then the simulation-based prediction interval for that percentile is calculated from \(Q_{1,b,p},\ldots,Q_{R,b,p}\). For example, a central 95% interval uses the 2.5th and 97.5th percentiles of those replicate-specific values. The observed percentile is then compared with this interval.

For the hand calculations below, empirical concentration percentiles use the nearest-rank convention: sort the \(n\) values as \(x_{(1)}\leq \cdots \leq x_{(n)}\), and define \(q_p=x_{(\lceil np\rceil)}\), where \(p\) is a proportion and \(\lceil\cdot\rceil\) rounds upward to the next integer. Software may use an interpolation convention instead; the convention should be consistent across observed and simulated data, and the plotted summaries should be calculated in the same way.

$$ q_p=x_{(\lceil np\rceil)}, \qquad PI_{b,p}=\left[Q_{(\lceil 0.025R\rceil),b,p},\;Q_{(\lceil 0.975R\rceil),b,p}\right] $$

Here \(PI_{b,p}\) is the simulation-based central 95% prediction interval for the \(p\)th concentration percentile in bin \(b\), and \(Q_{(j),b,p}\) is the \(j\)th ordered replicate-specific percentile. This interval describes the variation in that summary across replicated studies under the simulation setup. It is not a confidence interval for a model parameter.

Worked Example: Calculating Percentiles in an Early-Time Bin

Suppose ten hypothetical observed concentrations in a prespecified early-time bin are, in mg/L, \(8.1,\;8.7,\;9.2,\;9.8,\;10.4,\;11.0,\;11.8,\;12.5,\;13.4,\;14.2\). The values are already ordered. Calculate the 10th, 50th, and 90th percentiles using the nearest-rank convention.

For \(n=10\), the rank for the 10th percentile is \(\lceil10(0.10)\rceil=\lceil1\rceil=1\), so \(q_{0.10}=x_{(1)}=8.1\) mg/L. The rank for the 50th percentile is \(\lceil10(0.50)\rceil=5\), so \(q_{0.50}=x_{(5)}=10.4\) mg/L. The rank for the 90th percentile is \(\lceil10(0.90)\rceil=9\), so \(q_{0.90}=x_{(9)}=13.4\) mg/L.

Assume 500 hypothetical model-based data sets were simulated with the same design and the same bin boundaries. The observed 10th percentile might be compared with a simulated prediction interval of 7.4–8.8 mg/L, the median with 10.0–11.6 mg/L, and the 90th percentile with 12.8–14.4 mg/L. All three observed summaries fall inside their respective intervals. That is compatible with the fitted model for these summaries in this bin; it does not establish that the model is correct in every respect.

A Worked Two-Compartment Profile

Consider a hypothetical study with observations concentrated in three bins: early, intermediate, and terminal. The bins were chosen before inspecting the VPC summaries, based on the observation schedule and the changing pace of the concentration profile. Each bin contains ten observed concentrations. The table gives the observed nearest-rank percentiles and the central 95% simulation-based prediction intervals for each percentile, obtained from 500 simulated data sets.

Time binObserved \(q_{0.10}\) (mg/L)95% interval for \(q_{0.10}\)Observed \(q_{0.50}\) (mg/L)95% interval for \(q_{0.50}\)Observed \(q_{0.90}\) (mg/L)95% interval for \(q_{0.90}\)
Early8.17.4–8.810.410.0–11.613.412.8–14.4
Intermediate2.42.1–2.83.53.2–4.05.04.5–5.6
Terminal0.70.9–1.31.21.8–2.22.42.1–3.0

In the early bin, the observed 10th percentile, median, and 90th percentile all lie inside their respective intervals. The same is true in the intermediate bin. In the terminal bin, the observed 10th percentile is 0.7 mg/L, below the interval's lower limit of 0.9 mg/L; the observed median is 1.2 mg/L, below the lower limit of 1.8 mg/L; and the observed 90th percentile, 2.4 mg/L, is inside its interval. The pattern suggests that the observed lower and central parts of the terminal concentration distribution are lower than the model simulations typically produce, while the upper percentile is not similarly low.

Worked Example: Interpreting a Terminal-Phase Departure

For the terminal bin, suppose the ten hypothetical observed concentrations, in mg/L, are \(0.7,\;0.8,\;0.9,\;1.0,\;1.2,\;1.6,\;1.8,\;2.0,\;2.4,\;3.1\). Calculate the three percentiles and compare them with the simulated intervals in the table.

The values are ordered. The 10th-percentile rank is \(\lceil10(0.10)\rceil=1\), giving \(q_{0.10}=0.7\) mg/L. The median rank under the stated convention is \(\lceil10(0.50)\rceil=5\), giving \(q_{0.50}=1.2\) mg/L. The 90th-percentile rank is \(\lceil10(0.90)\rceil=9\), giving \(q_{0.90}=2.4\) mg/L.

The lower and median comparisons are \(0.7<0.9\) mg/L and \(1.2<1.8\) mg/L, respectively, so both summaries fall below their simulated intervals. The upper comparison is \(2.1\leq2.4\leq3.0\) mg/L, so the observed 90th percentile falls inside its interval. This is a distributional departure concentrated in the lower and central terminal summaries, not evidence that every terminal observation is too low. Possible explanations include a terminal decline that is too slow in the model or an overprediction of concentrations for much of the population. The VPC alone does not identify which parameter or model component is responsible.

Choosing Bins and Reading the Display

A VPC is usually displayed with time on the horizontal axis and concentration on the vertical axis. The observed percentile curves or points are overlaid on the corresponding simulation-based intervals. In a two-compartment profile, it is especially important to represent the early decline and later terminal trend without forcing each into a single broad time bin. Bins can be defined by prespecified time ranges or by groups of nearby observation times, but the choices should be guided by the sampling design and concentration-time dynamics, not by a desire to make a particular discrepancy disappear.

Worked Example: Why a Broad Time Bin Can Mislead

Suppose a hypothetical broad bin combines four early concentrations of 8, 10, 12, and 14 mg/L with four later concentrations of 2, 2.5, 3, and 3.5 mg/L. The ordered pooled values are \(2,\;2.5,\;3,\;3.5,\;8,\;10,\;12,\;14\). The ordinary sample median is the average of the fourth and fifth values: \((3.5+8)/2=5.75\) mg/L.

No observation in this example is close to 5.75 mg/L. The median combines two parts of a declining profile and could be mistaken for a typical concentration at some representative time. Separating early and later observations instead gives early median \((10+12)/2=11\) mg/L and later median \((2.5+3)/2=2.75\) mg/L. These summaries retain the time-course change that the broad bin obscures.

Several checks help distinguish a useful display from a misleading one:

  • Check the number of observations per bin. A percentile based on very few values is discrete and unstable; a bin with one observation cannot provide an informative empirical distribution.
  • Check the time spread within each bin. Wide bins may combine different parts of the distribution or profile, while extremely narrow bins can leave sparse summaries.
  • Inspect the lower, median, and upper summaries together. A shift in all three suggests a different pattern from a discrepancy in only one tail.
  • Assess whether apparent departures persist across adjacent bins. A coherent trend is generally more informative than one isolated point outside an interval.
  • Check that simulations reproduce the relevant design and observation process. Different dosing, sampling times, or record patterns can create a comparison that is not like-for-like.

What the Prediction Intervals Do—and Do Not—Say

If the fitted model and simulation setup are adequate, repeated simulated studies provide a reference distribution for each bin-specific percentile. A central 95% interval is constructed to contain about 95% of that percentile's simulated values, subject to Monte Carlo error and the chosen quantile convention. It is therefore reasonable to flag an observed percentile outside that interval as a potential mismatch for investigation. It is not correct to say that the interval gives a 95% probability that the model is correct.

The intervals are pointwise: each applies to a particular percentile in a particular bin. They do not guarantee that all percentiles in all bins will lie inside their intervals together. With many bins and summaries, occasional outside points can occur even when the model is adequate. The pattern, magnitude, and scientific relevance of departures matter, as do the number of bins inspected and the stability of the simulated envelopes.

Simulation noise can make interval boundaries jagged or uncertain, especially with too few replicates. Increasing the number of simulated data sets can stabilize the estimated envelope, but it does not solve sparse observed bins or a poorly chosen time partition. Conversely, a smooth-looking VPC is not evidence of fit if bins are so broad that important time-dependent differences have been averaged away.

A conventional VPC shows concentrations on their original scale. When variability increases with concentration, upper and lower tails may have visibly different absolute widths across time. That can be part of the model's predicted distribution rather than a defect in the display. Keep the observed and simulated summaries on the same scale and use the same percentile calculation. A plot on a logarithmic axis can help visualize a wide concentration range, but the plotted summaries and their units still need clear interpretation.

A VPC complements numerical predictive checks such as NPDE, which assess predictive deviations using a different summary and transformation. Neither display replaces examination of the model, the data, and the simulation setup. In particular, a VPC can reveal where in time and which parts of the concentration distribution depart from simulations, but it does not by itself diagnose the cause. Parameter uncertainty may also matter: a check that simulates only at fixed parameter estimates represents variability conditional on those estimates, not uncertainty in the estimates.

Common Pitfalls

Common mistake: “The observed median is outside its 95% interval in one bin, so the model is rejected with a 5% error rate.” This treats one pointwise predictive interval as a global hypothesis test and ignores the number of bins, simulation noise, and the size and coherence of the departure. The correction is to treat outside points as diagnostic evidence: examine neighboring bins, other percentiles, the data density, and the simulation design before deciding whether the pattern is consequential.

Another error is to compare the observed median with the prediction interval for individual simulated concentrations. The relevant comparison is between like summaries: the observed bin median is compared with the distribution of simulated bin medians. Likewise, an interval for the median across simulated data sets is not a 95% interval containing 95% of individual concentrations. Keeping these quantities distinct is essential for reading the plot correctly.

Finally, do not interpret a terminal-phase discrepancy as proof of a particular pharmacokinetic mechanism. A lower observed terminal median may be consistent with an overly slow predicted decline, but similar patterns can arise from other structural, variability, residual-error, or data-process features. The VPC locates a predictive mismatch; further model evaluation is needed to understand it.

Check Your Understanding

Answer each question using the definitions and calculations above. Brief solutions follow.

  1. In a bin with 20 observations, what rank does the nearest-rank convention use for the 90th percentile?
  2. An observed bin median is inside its simulation-based interval, but the observed 10th percentile is below its interval. What does this pattern say, and what does it not say?
  3. Why might a single broad bin covering early distribution and terminal times produce a misleading median?
  4. What is the distinction between a prediction interval for the median and an interval containing individual simulated concentrations?

Solutions. (1) The rank is \(\lceil20(0.90)\rceil=\lceil18\rceil=18\), so the percentile is the 18th ordered value. (2) The lower tail may be lower than simulations typically predict, while the central summary is compatible with its interval; this does not establish the cause or prove global model failure. (3) Concentrations change across the bin, so pooling can combine different times and produce a median that represents neither part of the profile. (4) The first interval is calculated from replicate-specific medians and describes variation in that summary; the second describes the spread of individual simulated concentrations. They are different quantities and should not be compared as if interchangeable.