Tutorials › Nonlinear Mixed-Effects Models (NLME) › Predictive Checks for Irregular Observation Schedules

Visual and Numerical Predictive Checks · Tutorial 597 of 797

Predictive Checks for Irregular Observation Schedules

You will learn how to simulate outcomes at the times actually observed, diagnose schedule-driven changes in pooled VPCs, and interpret NPDE using subject-specific observation-time covariance.

Intermediate 10 min read

What You'll Learn

  • Explain why predictive simulations should retain each subject’s actual observation times and design information.
  • Identify how the mix of subjects and observations in a time bin can shift pooled VPC summaries.
  • Distinguish schedule effects from prediction correction and from model misspecification.
  • Understand why NPDE covariance calculations must use each subject’s actual observation times.
  • Diagnose schedule-related problems using bin counts, stratification, and NPDE patterns.

Why Irregular Observation Times Matter

In a pharmacokinetic study, one subject may have samples at 0.5, 2, and 8 hours after a dose, while another has samples at 1 and 4 hours. A predictive check should evaluate the model against the design that produced the observations. If simulations instead place every subject on a common, convenient time grid, the check no longer represents the observed sampling process: it may create outcomes at unobserved times, omit observed times, or change which subjects contribute to a time-bin summary.

Irregular schedules matter in two related ways. First, predictive outcomes depend on the time of measurement, so simulating at the wrong time changes the comparison. Second, a pooled visual predictive check (VPC) summarizes the observations that fall in each time bin. The number and types of subjects contributing to a bin can vary across time. Consequently, pooled summaries can change with schedule composition even when the model’s predictions for each subject or subgroup have not changed. NPDE calculations have a related requirement: the covariance among a subject’s repeated outcomes must correspond to that subject’s actual observation times.

Definition: Subject \(i\)’s observation schedule is the set of times \(t_{ij}\) at which that subject’s outcome \(Y_{ij}\) was recorded, indexed by observation \(j\). A design-preserving predictive simulation retains those times, along with the relevant observed design information (such as dose history and covariates), while generating outcomes from the specified predictive model.

For a typical NLME model, the outcome at time \(t_{ij}\) can be written as \(Y_{ij}=f(t_{ij},\theta,\eta_i)+\epsilon_{ij}\), where \(\theta\) denotes population parameters, \(\eta_i\) the subject-specific random effects, and \(\epsilon_{ij}\) the residual error. A predictive check may simulate the random effects and residual errors according to its chosen unconditional or conditional target. Either way, if the purpose is to compare simulated and observed outcomes under the study design, the simulated outcome for subject \(i\), observation \(j\), is evaluated at that subject’s \(t_{ij}\). The earlier material on unconditional and conditional predictive checks distinguishes the targets; the schedule requirement applies to both.

Simulate at the Observed Times

In replicate \(r\), let \(Y_{ij}^{(r)}\) denote the simulated outcome corresponding to observed record \((i,j)\). A basic design-preserving procedure uses the same \(t_{ij}\) for every replicate, while regenerating the stochastic quantities required by the predictive target. When dose histories or covariates affect the prediction, those inputs should also match the record being simulated. The schedule is retained; the outcome is not copied from the observed data.

Worked Example: Evaluating a Curve on Three Irregular Schedules

Suppose a hypothetical one-compartment concentration curve, used here only to illustrate evaluation times, is \(C(t)=12e^{-0.25t}\) mg/L, with \(t\) in hours. Three subjects have schedules \((0.5,2,8)\), \((1,4)\), and \((0.5,1,6)\) hours. Evaluate the curve at those times rather than replacing the schedules with a common grid.

For subject 1, the values are \(C(0.5)=12e^{-0.125}=10.59\) mg/L, \(C(2)=12e^{-0.5}=7.278\) mg/L, and \(C(8)=12e^{-2}=1.624\) mg/L.

For subject 2, \(C(1)=12e^{-0.25}=9.346\) mg/L and \(C(4)=12e^{-1}=4.415\) mg/L. For subject 3, \(C(0.5)=10.59\) mg/L, \(C(1)=9.346\) mg/L, and \(C(6)=12e^{-1.5}=2.678\) mg/L.

These are evaluations of the same curve at different observed times; they are not a complete predictive simulation because no random effects or residual errors have been generated. In a predictive check, replicate-specific random effects and errors would be added or otherwise generated according to the stated model and check target. The time attached to each simulated record would remain the corresponding observed time.

A common-grid plot can still be useful for displaying a fitted typical curve, but it is not a substitute for design-preserving simulation in a predictive check. Interpolating observed outcomes onto a common grid is especially risky: interpolation creates values that were not measured and imposes assumptions about the trajectory between measurements. A grid may be used for display after the check, provided it is clear that it does not replace the record-level comparison at actual observation times.

How Schedule Composition Affects a Pooled VPC

A VPC compares observed outcome summaries with the corresponding summaries from simulated data, often within time bins. At a given time bin, the pooled observed quantile is calculated from the observations that actually fall in that bin. Simulated quantiles should be calculated from simulated records at those same subject-specific times and with a comparable binning rule. A pooled quantile is therefore a summary of both the predictive distributions and the records represented in the bin.

If subjects with different covariates, doses, or model-predicted concentrations contribute in different proportions across time bins, the pooled distribution can shift as that composition changes. This need not indicate that any subject’s prediction changed. It can instead reflect which subjects were sampled at that time. The following simplified calculation uses predicted values without residual error to isolate the composition effect.

Worked Example: A Pooled Summary Shifts When the Schedule Mix Changes

Consider a hypothetical time bin containing observations from two subgroups. Each subgroup’s predicted concentration in the bin stays fixed: 10 mg/L for subgroup A and 30 mg/L for subgroup B. Under one schedule, the bin contains one A observation and three B observations. Under another, it contains three A observations and one B observation. Calculate the pooled means and medians.

With one A and three B observations, the pooled mean is \((10+30+30+30)/4=100/4=25\) mg/L. The ordered values are 10, 30, 30, 30 mg/L, so the median is \((30+30)/2=30\) mg/L.

With three A and one B observation, the pooled mean is \((10+10+10+30)/4=60/4=15\) mg/L. The ordered values are 10, 10, 10, 30 mg/L, so the median is \((10+10)/2=10\) mg/L. The pooled mean decreases by \(25-15=10\) mg/L and the median by \(30-10=20\) mg/L, even though neither subgroup’s stated prediction changed.

This toy example illustrates composition, not a claim that VPCs should use means: VPCs commonly display quantiles. In real data, residual variability and subject-level differences also affect the quantiles. The central point remains that a pooled time-bin summary depends on who contributes observations to that bin. It should be interpreted alongside the bin’s observation count and, when useful, its subgroup composition.

Prediction correction can help address unequal typical predictions across observations, but it does not automatically make the sampling design irrelevant. In particular, it does not ensure that the same subject or covariate mix contributes to every time bin. Depending on the purpose of the check, useful complements include stratifying by an influential covariate or dose group, displaying the number of observations per bin, and showing the distribution of schedules or sampling times. Any weighting scheme changes the estimand: an observation-weighted summary describes the pooled records, whereas a subject-weighted summary gives subjects more equal influence. State which summary is being shown rather than treating these as interchangeable.

NPDE and the Subject-Specific Time Vector

For NPDE, the simulated outcomes for a subject form a vector ordered by that subject’s observed times. Their covariance depends on the observation times as well as on the model. For instance, two observations close together may have a different modeled residual or predictive correlation from two observations far apart. Thus the covariance matrix used for a subject must correspond to the same times and ordering as the observed outcome vector. Using a common-time covariance for subjects with different schedules can yield incorrectly standardized deviations.

The basic covariance transformation makes this requirement explicit. Suppose a subject’s predictive vector has mean \(\mu_i\) and positive-definite covariance matrix \(\Sigma_i\), both evaluated at that subject’s actual schedule. Let \(L_i\) be a Cholesky factor such that \(\Sigma_i=L_iL_i^\mathsf{T}\). The whitened deviation is \(Z_i=L_i^{-1}(Y_i-\mu_i)\). If \(Y_i\) has the specified multivariate normal predictive distribution, then the transformed vector has mean zero and identity covariance:

$$ \operatorname{Cov}(Z_i) =L_i^{-1}\Sigma_i(L_i^{-1})^\mathsf{T} =L_i^{-1}L_iL_i^\mathsf{T}(L_i^{-1})^\mathsf{T} =I. $$

This is the idealized covariance step behind NPDE. In practice, NPDE are estimated from simulated replicates, and the transformation includes the appropriate marginal normal-score step; finite simulation size and estimation affect the result. The derivation explains why the covariance must match the subject’s schedule: whitening removes the dependence represented by \(\Sigma_i\), not dependence from some other time vector.

Worked Example: Whitening Two Deviations at Irregular Times

For a hypothetical subject measured at two irregular times, suppose the observed-minus-predictive-mean vector is \(d=(2,1)^\mathsf{T}\) mg/L, and the predictive covariance matrix at those times is \(\Sigma=\begin{pmatrix}4&1\\1&1\end{pmatrix}\) \((\text{mg/L})^2\). Find the Cholesky-whitened deviation.

A lower-triangular Cholesky factor is \(L=\begin{pmatrix}2&0\\0.5&\sqrt{0.75}\end{pmatrix}\), because \(LL^\mathsf{T}=\Sigma\). Solve \(Lz=d\). The first row gives \(2z_1=2\), so \(z_1=1\). The second gives \(0.5(1)+\sqrt{0.75}z_2=1\), hence \(z_2=0.5/\sqrt{0.75}=0.5774\). Thus \(z=(1,0.5774)^\mathsf{T}\), a dimensionless whitened deviation.

This is the covariance-whitening calculation, not a full finite-simulation NPDE calculation. In an actual analysis, the predictive mean and covariance (or their simulation-based estimates) must be computed for this subject’s observed time vector, and the NPDE marginal transformation must follow the estimation procedure being used. Reusing this covariance for a subject sampled at different times would not be justified.

Diagnostics, Alternatives, and Limitations

Several checks help identify schedule-related failures before interpreting a predictive plot or NPDE summary:

  • Verify record alignment. For each simulated record, check subject identity, observation index, time, and any design inputs used by the model. A time-ordering or matching error can invalidate both VPC bins and covariance calculations.
  • Inspect bin support. Report the number of observed records contributing to each time bin, and examine whether particular covariate, dose, or schedule groups dominate. Sparse bins make quantiles unstable, quite apart from any model problem.
  • Compare composition across bins. If the mix of subjects changes over time, assess whether the pooled pattern is consistent with that change. Stratified summaries can help distinguish a within-group discrepancy from a changing pooled mix, though they may be imprecise when strata are small.
  • Check the NPDE time vector and covariance. Confirm that the order and dimension of the observed vector, simulated vectors, and covariance matrix agree for every subject. Look for residual trends or remaining dependence in NPDE; a transformation based on mismatched times cannot remove the dependence of the intended predictive distribution.
  • Check numerical stability. Very sparse schedules, nearly redundant observations, or too few simulated replicates can make covariance estimates unstable or singular. Investigate the cause rather than silently substituting a covariance from another schedule.

An ordinary pooled VPC is useful for showing how the model predicts the population of observed records, but its summary can be driven by schedule composition. Stratified VPCs make selected design differences more visible at the cost of smaller bin sizes. Prediction-corrected VPCs address variation in typical predictions under their stated construction, but do not by themselves correct a changing mix of subjects. NPDE use within-subject predictive covariance to assess standardized deviations and dependence, but depend on an adequate predictive distribution and reliable simulation-based estimates. None of these displays can compensate for incorrect timing records or an incorrectly specified model.

Common pitfall: Simulating everyone on a regular grid and then treating the resulting pooled quantiles as directly comparable with the observed VPC. The grid changes which records exist at each time and may change the bin’s subject composition. Preserve each subject’s actual schedule for the record-level simulation, then use the same binning and summary rules for observed and simulated records. If a grid is shown for visualization, label its role and do not confuse it with the design used for the check.

Check Your Understanding

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

  1. Subject A is observed at 1 and 6 hours, and subject B at 2 and 4 hours. Which times should their outcomes use in a design-preserving predictive simulation?
  2. In a bin, predictions are 8 mg/L for group A and 20 mg/L for group B. The bin has two A and two B records. What is the pooled mean? If the schedule mix becomes three A and one B, what is the new pooled mean, assuming the group predictions are unchanged?
  3. Why must an NPDE covariance matrix correspond to the subject’s actual observation times?
  4. Name two diagnostics that can help distinguish a schedule-composition effect from a model-prediction discrepancy in a pooled VPC.

Solutions. (1) Simulate subject A at 1 and 6 hours and subject B at 2 and 4 hours, retaining the relevant design inputs; do not replace those times with a common grid. (2) Initially, \((8+8+20+20)/4=56/4=14\) mg/L. With three A and one B record, \((8+8+8+20)/4=44/4=11\) mg/L. The pooled mean changes by 3 mg/L although the group predictions are fixed. (3) The predictive covariance represents dependence among outcomes at a particular set and ordering of times; whitening with a covariance for a different schedule does not standardize the intended predictive vector. (4) Report bin counts and inspect subgroup or covariate composition across bins; stratified summaries are another useful diagnostic when there are enough observations per stratum.