What a VPC Prediction Interval Describes
A visual predictive check (VPC) compares summaries of the observed data with the same summaries calculated from replicate data simulated under a fitted model. Within each time bin, these summaries might include the median or selected quantiles. A prediction interval shows how much a particular summary can vary across replicated data sets if the simulation model and design are appropriate.
The interval is for a summary, such as the median concentration in one bin, not for an individual concentration and not for a model parameter. Its width reflects variation in that summary across simulated data sets. It depends on the model, simulation procedure, number and timing of observations, bin definitions, and the number of individuals represented.
For example, a 95% interval for the median in one bin describes the central 95% of replicated medians under the specified simulation procedure. It is pointwise: its coverage refers to one chosen bin and one chosen summary. It does not, by itself, give 95% coverage simultaneously for every bin and every displayed quantile.
Assumptions and Calculation
The calculation is straightforward, but its interpretation depends on the simulation being aligned with the target predictive check. The simulated data should represent replicate data sets for the intended study design. In particular, use the same relevant observation times, bin boundaries, and summary definition for observed and simulated data. The simulation should also include the sources of variability intended by the check, such as between-subject variability and residual error when the target is a population-level predictive check.
A common plug-in procedure uses the fitted parameter estimates and generates new random effects and residual errors from the fitted model. The resulting interval is conditional on those parameter estimates. Parameter uncertainty is not automatically included merely because many data sets were simulated; it must be included by the simulation procedure if it is part of the intended predictive target. The distinction matters when estimates are imprecise.
For reproducibility, choose and state a quantile convention. In the examples here, empirical quantiles use the nearest-rank rule: for ordered values \(x_{(1)}\leq \cdots \leq x_{(m)}\), the empirical \(q\) quantile is \(x_{(\lceil mq\rceil)}\), where \(\lceil \cdot \rceil\) means round up to the next integer. Other software conventions may interpolate between adjacent ordered values, so results can differ slightly, especially with few replicates.
The ordered simulated summaries approximate the predictive distribution of the statistic. The interval endpoints are estimates of its lower and upper predictive quantiles. This construction is a direct Monte Carlo approximation: as the number of independent replicate data sets increases, the empirical distribution of their summaries generally becomes a more stable approximation to the simulation distribution.
Worked Calculations
Worked Example: A 95% Interval for a Bin Median
In a hypothetical study, ten observed concentrations fall in one time bin. Sorted from smallest to largest, they are 7.4, 8.2, 9.1, 9.8, 10.6, 11.4, 12.0, 13.1, 14.0, and 15.2 mg/L. The observed median is the mean of the fifth and sixth values:
Suppose \(S=200\) replicate data sets were simulated using the same bin and study observation design. The 5th and 195th ordered simulated bin medians are 8.6 mg/L and 12.1 mg/L, respectively. For a 95% interval, \(\alpha=0.05\), so the nearest-rank indices are:
The simulation-based interval is therefore \([8.6,12.1]\) mg/L. The observed median, 11.0 mg/L, lies within it. This says that the observed median is not in the lower or upper 2.5% tails of the simulated median distribution under this pointwise check. It does not establish that the model is correct.
Worked Example: An Interval for the 90th Percentile
For a second hypothetical bin, the ten observed concentrations, in increasing order, are 4.0, 4.8, 5.3, 6.1, 7.0, 8.2, 9.4, 10.1, 12.6, and 16.0 mg/L. Using the nearest-rank rule, the observed 90th percentile is the 9th ordered value:
There are 100 simulated replicate summaries for this same percentile. Suppose their 5th and 95th ordered values are 9.8 mg/L and 15.4 mg/L. These are the endpoints of the central 90% interval, since:
Thus the 90% prediction interval is \([9.8,15.4]\) mg/L, and the observed 90th percentile of 12.6 mg/L falls inside it. The comparison is between the observed 90th percentile and simulated 90th percentiles, not between an observation and the simulated interval.
Worked Example: A Small Number of Replicates
Suppose 40 hypothetical replicate data sets produce ordered bin medians whose second value is 5.2 mg/L and whose 38th value is 7.9 mg/L. The observed bin median is 8.1 mg/L. For a 90% interval, the nearest-rank indices are:
The 90% interval is therefore \([5.2,7.9]\) mg/L. Since 8.1 mg/L is greater than 7.9 mg/L, the observed median lies above this interval. This is a potentially notable discrepancy for this bin and summary, but 40 replicates provide limited resolution: the endpoints are determined by just the second and 38th ordered values. Increasing the number of simulations can make the estimated tails more stable, although it cannot repair a misspecified model or an inappropriate design.
Why the Procedure Works, and What to Check
Let \(T^*_{b,p}\) denote the summary that would be calculated from a new replicate data set under the specified model, design, and simulation scheme. If \(L\) and \(U\) are its true lower and upper \(\alpha/2\) predictive quantiles, then, for a continuous predictive distribution,
The approximation allows for endpoint conventions and possible discreteness. In practice, \(L\) and \(U\) are unknown. The simulated summaries act as draws from the predictive distribution, and their empirical quantiles estimate \(L\) and \(U\). Thus the interval has its stated predictive interpretation only relative to the assumed model and simulation procedure; it is not a model-free guarantee.
Specify the bin \(b\), the statistic (for example, median or 90th percentile), and the quantile convention before comparing observed and simulated values.
Use the observed values assigned to that bin. Record the number of values as well as the summary, since a sparse bin can yield an unstable quantile.
For each simulated data set, apply the same bin assignment and summary calculation. Do not pool observations across replicate data sets before calculating the summaries.
Sort the \(S\) replicate summaries and take the ranks for the chosen interval level. Compare the observed summary with those endpoints, retaining its units and bin context.
Several checks help identify a calculation that is going wrong:
- Check bin membership and design. Observed and simulated summaries must refer to the same time boundaries and intended observation schedule. A mismatch changes the distribution being compared.
- Check counts and empty bins. If a bin has no observations, its observed summary is undefined. If it has very few observations, its median or tail quantile can change sharply when one value changes. Do not silently treat an empty-bin summary as zero.
- Check the replicate summaries, not just the plotted endpoints. Recalculate selected medians or quantiles from a replicate to verify that the right observations and quantile convention were used.
- Check Monte Carlo stability. With too few simulations, tail endpoints depend heavily on a few ordered values. Repeating the simulation with more replicates can reveal whether the endpoints are stable.
- Check the simulation target. A narrow interval can result when relevant variability was omitted from simulation. Conversely, if the intended check is conditional on particular subject effects or design features, simulating a different target may produce an interval that answers the wrong question.
The empirical interval is often preferable to imposing a normal distribution on the simulated summaries: medians and tail quantiles can have asymmetric or otherwise non-normal sampling distributions, particularly in small or sparse bins. A normal-approximation interval may be a useful comparison when its assumptions are justified, but it does not replace checking the simulated distribution. A different alternative is to bootstrap the observed data to quantify uncertainty in the observed summary. That addresses sampling uncertainty around the observed summary; it is not the same as predicting the summary in new data sets under the fitted model.
Interpretation and Limitations
An observed summary inside its prediction interval is compatible with the simulated variability for that particular bin and summary. An observed summary outside the interval flags a discrepancy worth investigating; it is not, by itself, proof of model failure. The discrepancy may reflect model misspecification, an unrepresentative observed sample, sparse-bin instability, simulation error, or a mismatch in design or data processing.
Intervals are commonly examined for several bins and several summaries. Because each interval is pointwise, the chance that at least one observed summary falls outside its interval across a collection of checks can exceed the nominal tail probability for any single interval. These intervals should therefore be read as diagnostic comparisons, not as simultaneous coverage bands or independent hypothesis tests. Their interpretation also depends on the fitted model: when parameter uncertainty is not propagated, the intervals can understate predictive uncertainty if that uncertainty is substantial.
The introductory material on visual predictive checks establishes the role of comparing observed summaries with simulated summaries. The practical extension here is to preserve that comparison at the level of each bin-specific statistic, including its uncertainty across replicate data sets. Binning and sample size remain important limitations: a large number of simulated data sets cannot make an observed within-bin quantile precise when few observed values contribute to it.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- For \(S=200\) simulations, what nearest-rank indices define a two-sided 90% interval?
- An observed bin median is 14.2 mg/L and its simulated 95% interval is \([9.5,13.8]\) mg/L. State the diagnostic comparison without claiming that the model is certainly false.
- Why is a prediction interval for a VPC median not a confidence interval for a typical model parameter?
- What is wrong with calculating one median after pooling observations from all simulated replicate data sets?
Solutions. (1) Here \(\alpha=0.10\), so the ranks are \(\lceil200(0.05)\rceil=10\) and \(\lceil200(0.95)\rceil=190\). (2) The observed median is 0.4 mg/L above the upper endpoint, flagging a discrepancy for that bin and summary under the specified simulation scheme; it warrants investigation but does not alone prove model failure. (3) The interval describes variation in a simulated data summary, whereas a confidence interval describes uncertainty about an estimated parameter or other target. (4) Pooling mixes observations across replicate data sets and removes the replicate-to-replicate variation needed to estimate the predictive distribution of the median.