Tutorials › Physiologically-Based Pharmacokinetics (PBPK) › Diagnosing Failed Fed-State Emptying Predictions

Food Effects and Gastric Emptying · Tutorial 295 of 799

Diagnosing Failed Fed-State Emptying Predictions

Learn a structured diagnostic approach for determining why a fed-state gastric-emptying model misses observed pharmacokinetic profiles across time and meal conditions.

Advanced 10 min read

What You'll Learn

  • Define raw and log-scale residuals for comparing observed and predicted concentration profiles.
  • Use the direction and timing of residual patterns to assess whether predicted emptying may be too early or too late.
  • Check gastric and intestinal drug-mass balances to detect losses or duplicated transfers.
  • Compare meal-specific prediction errors to identify weak generalization and possible overfitting.
  • Separate emptying-model clues from alternative explanations such as absorption or formulation errors.

Why a Fed-State Prediction Can Fail

A model may reproduce a concentration profile after one meal and still give unreliable predictions after another. It may also match a peak concentration while misrepresenting when drug leaves the stomach, or generate plausible plasma concentrations despite transferring more drug than was administered. Diagnosis therefore requires more than asking whether the predicted curve looks close to the observed curve. The pattern of errors, the accounting of drug mass, and performance across meal conditions each provide different evidence.

This tutorial treats a failed prediction as a diagnostic problem, not as proof that gastric emptying is the cause. The same concentration discrepancy can arise from an incorrect emptying time course, a state-transition implementation error, or other model components that influence intestinal input and systemic concentrations. A useful diagnosis first checks what the model actually did, then asks whether the remaining error has a pattern consistent with the proposed mechanism.

Definition: At time \(t_i\), define the raw concentration residual as \(e_i=C_{\mathrm{obs},i}-C_{\mathrm{pred},i}\), where \(C_{\mathrm{obs},i}\) is the observed concentration and \(C_{\mathrm{pred},i}\) is the model prediction at the same time. A positive residual means the model underpredicts concentration; a negative residual means it overpredicts. When concentrations are positive, the log residual \(r_i=\ln(C_{\mathrm{obs},i}/C_{\mathrm{pred},i})\) expresses the discrepancy as a dimensionless ratio: positive values indicate underprediction and negative values indicate overprediction.

The sign convention matters: some software reports prediction minus observation instead. Always check the convention before interpreting a residual plot. Raw residuals retain concentration units, while log residuals are useful for comparing proportional errors across concentration ranges. Neither measure, by itself, identifies the cause of a mismatch.

Assumptions and a First Diagnostic Principle

A meaningful comparison requires that observed and predicted profiles refer to the same dose, formulation, administration time, meal condition, and sampling times, with compatible concentration units. Meal timing and fed-state transitions must be represented consistently in the simulation and the data. If sampling times are misaligned, a timing error can look like a model error. If the model and data refer to different meal conditions, a residual pattern cannot be interpreted as a clean test of the model for that condition.

The residuals are diagnostic signals, not independent measurements of gastric emptying. Their interpretation is strongest when the disposition model and other relevant components have been assessed independently or are held consistent across the comparison. For example, a low early concentration could reflect delayed gastric emptying, but it could also result from an error in another process between the stomach and measured plasma concentration. Earlier material on separating emptying effects from other food effects is relevant when evaluating these competing explanations.

Worked Example: Reading a Time-Structured Residual Pattern

Suppose a hypothetical fed-state simulation predicts the following plasma concentrations. The observed and predicted values are in mg/L, and the times are hours after dosing.

Time (h)Observed (mg/L)Predicted (mg/L)Residual, observed − predicted (mg/L)
158−3
31012−2
6853
10321

At 1 h, \(e=5-8=-3\) mg/L, so the model overpredicts. At 6 h, \(e=8-5=3\) mg/L, so it underpredicts. The sign changes from negative at earlier times to positive later, rather than remaining consistently on one side of zero. If other relevant model components are credible, that pattern is consistent with a predicted input profile that is too early: too much concentration appears early and too little later. It is a clue to investigate, not proof that emptying alone is responsible.

Why a Timing Shift Produces Opposite-Signed Errors

A simple approximation helps explain this diagnostic pattern. Let \(C_{\mathrm{pred}}(t)\) be a predicted concentration curve that has the right general shape but is shifted earlier than the observed curve by a small time \(\delta>0\). Under the simplifying assumption that the downstream concentration response is otherwise unchanged, write \(C_{\mathrm{obs}}(t)\approx C_{\mathrm{pred}}(t-\delta)\). A first-order Taylor expansion gives:

$$ C_{\mathrm{obs}}(t)-C_{\mathrm{pred}}(t) \approx -\delta \frac{dC_{\mathrm{pred}}(t)}{dt}. $$

On the rising part of the predicted curve, \(dC_{\mathrm{pred}}/dt>0\), so the approximate residual is negative: the prediction is too high at that time. On the falling part, \(dC_{\mathrm{pred}}/dt<0\), so the approximate residual is positive: the prediction is too low. This justification depends on a small shift and a similar profile shape. If the curve shape, bioavailability, or disposition also differs, the simple sign pattern may not hold.

In practice, inspect residuals against time within each meal condition, not only a single aggregate statistic. A persistent offset across the whole profile suggests a different kind of discrepancy from a sign change around the peak. Repeated observations and the variability of the measurements also matter: a few points on either side of zero are not compelling evidence of a systematic pattern.

Check the Drug-Mass Ledger Before Tuning Parameters

A gastric-emptying implementation transfers drug from a gastric compartment into the intestine. That transfer must be counted once, and the amount left in a compartment cannot be negative. A mass balance is a direct test of whether the simulated state changes conserve drug, allowing for explicitly modeled losses such as degradation. It does not establish that the emptying rate is physiologically correct; it establishes whether the model’s accounting is internally consistent.

Mass-balance check: For an initial gastric amount \(A_0\), cumulative amount emptied \(E\), gastric amount remaining \(A_g\), and cumulative gastric loss \(L_g\), the gastric balance is \(A_0=A_g+E+L_g\). For the intestinal compartment, if \(A_i\) is the amount remaining in the intestine, \(A_{\mathrm{abs}}\) is cumulative absorption, and \(L_i\) is cumulative intestinal loss, then \(E=A_i+A_{\mathrm{abs}}+L_i\). These balances apply when the stated compartments and loss terms account for all drug transfers in the model.

Worked Example: Finding a Duplicate State Transfer

In a hypothetical simulation, 100 mg enters the stomach. At a selected time, 15 mg remains there, cumulative gastric loss is 3 mg, and the recorded cumulative amount emptied is 82 mg. Check the gastric balance.

The accounted amount is \(15+3+82=100\) mg, equal to the initial 100 mg. The gastric balance closes. Suppose the intestinal ledger records 20 mg remaining, 57 mg cumulatively absorbed, and 5 mg lost. These sum to \(20+57+5=82\) mg, equal to the 82 mg emptied from the stomach. The intestinal balance also closes.

Now suppose a state-transition routine adds the same 10 mg transfer twice, so the logged amount emptied is 92 mg while the gastric remainder and loss remain 15 mg and 3 mg. The gastric total becomes \(15+3+92=110\) mg. The excess is \(110-100=10\) mg: the model has created 10 mg in its ledger. That discrepancy points to an implementation or accounting problem, such as a transfer being applied twice. It should be resolved before changing an emptying parameter to improve the plasma fit.

Check balances at intermediate times and around transitions, not just at the end of the simulation. A final total can look acceptable if positive and negative accounting errors cancel. Check that amounts do not become negative, that cumulative emptying does not decrease, and that meal-state changes do not inadvertently reset or duplicate a drug amount. The appropriate accounting depends on the compartments and loss processes actually included; do not label unmodeled drug as a loss simply to force a balance.

Use Meal-Specific Errors to Test Generalization

A good fit under one meal condition does not guarantee a valid description of other conditions. Meal composition and timing can alter gastric-emptying behavior, so a model that effectively captures one condition may fail when transferred to another. Keep condition-specific errors visible rather than averaging them into one score that can hide opposing or localized failures.

For a positive observed summary quantity \(Y_{\mathrm{obs}}\), such as area under the concentration-time curve, one useful signed percentage error is \(100(Y_{\mathrm{pred}}-Y_{\mathrm{obs}})/Y_{\mathrm{obs}}\). A negative value indicates underprediction; a positive value indicates overprediction. This summarizes the direction and relative size of error for that quantity, but it does not describe the full concentration-time profile.

Worked Example: Detecting a Meal-Specific Prediction Failure

Consider hypothetical observed AUC values of 100 and 150 mg·h/L for Meal X and Meal Y, respectively. A flexible model fitted to Meal X predicts 100 mg·h/L for X but 110 mg·h/L for Y. A constrained shared-parameter model predicts 92 mg·h/L for X and 138 mg·h/L for Y. Calculate the signed percentage errors.

For the flexible model, Meal X has \(100(100-100)/100=0\%\) error. Meal Y has \(100(110-150)/150=-26.67\%\), an underprediction of about 26.7%. For the shared-parameter model, Meal X has \(100(92-100)/100=-8.0\%\), and Meal Y has \(100(138-150)/150=-8.0\%\). The flexible model matches its fitting condition but performs substantially worse on Meal Y; the shared model has modest underprediction in both conditions.

This comparison raises a generalization concern for the model fitted only to Meal X. It does not prove that the shared model is correct: the full time profiles, data variability, and the scientific rationale for each model still matter. In particular, a shared parameter should not be imposed merely because it produces similar errors across meals if the physiology supports genuine meal dependence.

A Practical Diagnostic Sequence

Use the following sequence to move from an observed discrepancy to a defensible next check. It keeps implementation errors separate from model inadequacy and helps prevent parameter adjustment from concealing either.

1
Verify the comparison.
Confirm dose, formulation, meal condition, meal and dose times, sampling times, units, and the residual sign convention.
2
Inspect residuals by time and meal.
Look for persistent bias, a sign change around the peak, or errors confined to a particular condition. Do not infer a cause from one point.
3
Audit states and mass.
Check compartment amounts, cumulative transfers and losses, nonnegativity, and behavior at meal-state transitions, including intermediate simulation times.
4
Compare conditions and alternatives.
Assess prediction errors separately across meals. If accounting is sound, investigate whether emptying assumptions or other model components better explain the remaining pattern.

How to Distinguish Common Failure Modes

Residuals and mass balances answer different questions, so they should be interpreted together. A failed balance is evidence of inconsistent accounting, even if the plasma prediction looks reasonable. A closed balance with a meal-specific, time-structured residual pattern indicates that the model conserves mass but may still represent timing or other processes incorrectly. A closed balance and a good fit in one condition do not establish general validity in other conditions.

Observed diagnosticWhat it supportsWhat to check next
Negative early residuals followed by positive later residualsA timing mismatch is plausible; predicted input may be too early under the stated assumptions.Inspect the emptying time course and other processes affecting the profile shape.
Gastric or intestinal balance does not closeA missing, duplicated, or incorrectly applied transfer or loss is possible.Trace amounts through each compartment and state transition.
One meal fits well but another has a large signed errorCondition-specific behavior may be inadequately represented, or fitting may not generalize.Compare time profiles and assess predictions in conditions not used for fitting.
Residuals have a similar offset across times and mealsA timing-only explanation is less compelling; another systematic discrepancy may be present.Review scale, dose, and relevant model components before retuning emptying.

These patterns are not unique fingerprints. For example, an early-negative/later-positive pattern can be consistent with delayed input, but it cannot by itself exclude changes in absorption or other factors that reshape plasma concentrations. Likewise, a meal-specific error may arise from an incorrect meal effect, an implementation error triggered by a state transition, or data and design differences between conditions. The diagnosis should remain proportional to the evidence.

Common Mistakes and Limitations

  • Tuning emptying before checking implementation. A parameter change may compensate for a duplicated transfer or an incorrectly timed state change. Verify the mass ledger and event handling first.
  • Calling every peak mismatch an emptying error. A concentration peak reflects more than gastric emptying. Treat the residual shape as a clue and consider alternative contributors.
  • Using a pooled fit to hide meal failures. Summaries across conditions can conceal a large underprediction in one meal and a smaller error in another. Report condition-specific performance.
  • Calling a parameter set “overfit” solely because it is flexible. Flexibility is a concern when fit to a particular condition fails to generalize or is unsupported by evidence; flexibility alone is not proof of overfitting.
  • Assuming a closed mass balance proves physiological validity. Conservation is necessary for consistent accounting, but it does not establish that the transfer time course or meal response is correct.

A further limitation is that data may not distinguish competing explanations: several combinations of emptying, intestinal input, and other processes can produce similar plasma profiles. Conclusions should therefore identify what the diagnostics support and what remains uncertain, rather than assigning a unique cause when the evidence does not do so.

Check Your Understanding

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

  1. At a sampling time, \(C_{\mathrm{obs}}=4\) mg/L and \(C_{\mathrm{pred}}=6\) mg/L. What is the raw residual, and what does its sign mean?
  2. A predicted curve is too early but has approximately the right shape. What residual signs are expected on its rising and falling phases?
  3. A gastric compartment starts with 80 mg. It has 12 mg remaining, 4 mg of gastric loss, and 60 mg recorded as emptied. Does the balance close?
  4. Observed AUC under a meal is 120 mg·h/L, while predicted AUC is 90 mg·h/L. Calculate the signed percentage error and interpret it.
  5. Why does a closed drug-mass balance not establish that the fed-state emptying assumption is correct?

Solutions. 1. \(e=4-6=-2\) mg/L, so the model overpredicts by 2 mg/L. 2. The expected pattern is a negative residual on the rising phase and a positive residual on the falling phase, under the small-shift and similar-shape approximation. 3. \(12+4+60=76\) mg, which is 4 mg below the initial 80 mg; the balance does not close, so an amount or loss is unaccounted for. 4. \(100(90-120)/120=-25\%\), indicating that predicted AUC is 25% below observed AUC. 5. A closed balance shows that amounts are accounted for; it does not show that the timing or meal dependence of emptying matches physiology or observations.