Tutorials › Bioavailability and Bioequivalence › Residual Diagnostics for IVIVC Model Fit

Formulation Effects and In Vitro-In Vivo Correlation · Tutorial 351 of 399

Residual Diagnostics for IVIVC Model Fit

Use residual patterns, influence checks, and scale-aware error summaries to diagnose where an IVIVC fit is failing and what the diagnostics can—and cannot—establish.

Advanced 12 min read

What You'll Learn

  • Define observed-minus-predicted IVIVC residuals and interpret their signs in context.
  • Read residual plots for time-dependent bias, curvature, and changing variability.
  • Assess whether a formulation has disproportionate influence on the fitted relationship.
  • Calculate bias, mean absolute error, and root mean squared error from residuals.
  • Distinguish descriptive fit diagnostics from internal and external predictability.
  • Recognize why dependence, bounded outcomes, and sparse formulation coverage limit common diagnostics.

Why Diagnose Residuals?

A small overall discrepancy between an IVIVC model and its data can conceal a consequential pattern. A model may systematically underpredict absorption early and overpredict it later, or it may fit most formulations well only because one formulation strongly determines the fitted mapping. Residual diagnostics help locate those failures and suggest whether the dissolution-to-absorption mapping, its time alignment, or the data structure needs closer examination.

The focus here is model fit: how the fitted IVIVC relates to the observations used to estimate it. Diagnostics are not, by themselves, evidence that the model predicts a new formulation accurately. Internal predictability and external validation are separate evaluations.

Definition: For observation \(i\), define the residual as \(e_i=y_i-\hat{y}_i\), where \(y_i\) is the observed response and \(\hat{y}_i\) is the response predicted by the fitted model. In a Level A IVIVC diagnostic using fraction absorbed, \(e_i\) is observed fraction absorbed minus model-predicted fraction absorbed. A positive residual means the model underpredicts the observed fraction; a negative residual means it overpredicts it.

Residuals are in the response’s units. If the response is a fraction, residuals are fractions; multiplying by 100 expresses them in percentage points. For a model fitted to deconvolved fraction absorbed, observations can share information through common subjects, sampling times, or formulation-level processing. Residuals should therefore be treated as structured diagnostic quantities, not automatically as independent observations from a simple regression model.

What to Plot and What Patterns Mean

Begin with residuals against time, fitted response, the dissolution input used in construction, and formulation. Where data permit, also inspect residuals by subject, batch, study period, and relevant experimental conditions. Use the same response scale as the fitted model, and label axes with units. Plotting points in time order within each formulation can reveal a pattern that is hidden when all observations are pooled.

  • Residuals against time: a sustained positive or negative run suggests time-dependent bias. A curved pattern can indicate that a single linear mapping is inadequate, or that time scaling or lag alignment is not capturing the relationship.
  • Residuals against fitted values or dissolution input: curvature suggests a nonlinear relationship left unexplained by the chosen mapping. A widening or narrowing spread suggests nonconstant variability.
  • Residuals by formulation: a formulation with consistently signed residuals may be poorly represented by the common mapping. A formulation with unusually large residuals may also be influential, but residual size alone does not establish influence.
  • Residuals by subject, batch, or study period: clusters or shifts can point to data structure or experimental differences that a formulation-level curve does not represent.

A pattern is a diagnostic signal, not a proof of a specific biological mechanism. For example, late positive residuals could reflect a mapping that rises too slowly at late times, but they could also arise from errors in time alignment, measurement, or deconvolution. Check the data processing and study context before changing the model form.

Worked Example: Detecting Increasing Time-Dependent Bias

Suppose a hypothetical formulation has observed and predicted fractions absorbed at four time points. The residual is observed minus predicted.

Time (h)Predicted fractionObserved fractionResidual
10.150.170.02
20.350.400.05
30.600.680.08
40.820.910.09

For example, at 3 h, \(e=0.68-0.60=0.08\), meaning the prediction is 0.08 fraction units, or 8 percentage points, below the observation. The residuals are positive at every time and increase from 0.02 to 0.09. Their mean is \((0.02+0.05+0.08+0.09)/4=0.060\), or 6 percentage points.

This is evidence of underprediction in these observations, with larger discrepancies later in time. It is not enough to conclude that the model is generally biased in every formulation: the example contains only one formulation. Inspect other formulations and verify time alignment and response processing before attributing the pattern to the mapping itself.

A Short Justification for Looking for Trends

A useful way to summarize a time plot is to ask whether residuals tend to change with time. If residuals have no systematic time trend, their linear association with time should be absent in the population represented by the model. This motivates a descriptive regression of residuals on time, \(e_i=\gamma_0+\gamma_1t_i+u_i\), where \(t_i\) is time and \(u_i\) is the remaining variation.

$$ \hat{\gamma}_1= \frac{\sum_i (t_i-\bar{t})(e_i-\bar{e})} {\sum_i (t_i-\bar{t})^2} $$

The numerator measures whether residuals tend to be positive at later times and negative at earlier times, or vice versa. If residuals are systematically increasing with time, that covariance is positive and the estimated slope tends to be positive. This calculation is a compact description of a plotted pattern; a conventional significance test for \(\gamma_1\) would require assumptions about dependence and variability that may not hold for repeated IVIVC observations. A plot and the scientific structure of the data remain essential.

Influence: Which Formulations Shape the Fit?

An observation is influential when removing or changing it would substantially alter fitted model parameters or fitted values. In ordinary least-squares regression, leverage measures how unusual an observation’s predictor values are relative to the others, while a large residual measures a discrepancy between observed and fitted responses. Cook’s distance combines these ideas to describe the change in the fitted regression when an observation is omitted.

For a linear least-squares model with \(p\) fitted parameters, leverage \(h_i\), and internally standardized residual \(r_i\), a common diagnostic expression is \(D_i=(r_i^2/p)\{h_i/(1-h_i)\}\). These quantities are useful for a simple linear mapping, but their familiar reference rules do not automatically apply to nonlinear, weighted, correlated, or constrained IVIVC fits. In those settings, a direct and interpretable check is to refit the model after omitting each formulation in turn and compare the estimated mapping and fitted curves.

Worked Example: Screening a Potentially Influential Formulation

Suppose a hypothetical linear IVIVC fit has \(p=2\) parameters. For one formulation-level diagnostic point, software reports leverage \(h_i=0.45\) and internally standardized residual \(r_i=2.0\). Use Cook’s distance as a screening summary.

Substituting into the formula gives

$$ D_i=\frac{2.0^2}{2}\left(\frac{0.45}{1-0.45}\right) =2\left(\frac{0.45}{0.55}\right) =1.64. $$

This value warrants investigation: the point combines a relatively large residual with substantial leverage. It does not establish that the formulation is erroneous or that the model is invalid. Check the formulation’s data and study conditions, then refit without that formulation. If key parameters or predictions change markedly, the fitted relationship depends strongly on it. If the actual model is nonlinear or uses clustered observations, use a refitting strategy appropriate to that model rather than interpreting this linear-regression formula as a calibrated test.

Influence must be assessed at the level that matters. Several time points from one formulation are not several independent formulations. Deleting one time point may diagnose local sensitivity, but it does not answer whether the overall relationship depends on that formulation. Conversely, a formulation can be influential even if its residuals are not the largest, because its dissolution values may cover a part of the predictor range poorly represented by other formulations.

Error Summaries: Useful, but Incomplete

Residual summaries provide compact measures of discrepancy. For \(n\) residuals, mean error describes signed average bias, mean absolute error (MAE) describes average absolute discrepancy, and root mean squared error (RMSE) gives greater weight to larger discrepancies. If \(e_i\) is in fraction units, each summary is also in fraction units.

$$ \text{Mean error}=\frac{1}{n}\sum_{i=1}^{n}e_i,\qquad \text{MAE}=\frac{1}{n}\sum_{i=1}^{n}|e_i|,\qquad \text{RMSE}=\sqrt{\frac{1}{n}\sum_{i=1}^{n}e_i^2}. $$

Mean error can be near zero because positive and negative residuals cancel, even when individual errors are large. MAE avoids that cancellation; RMSE emphasizes large misses. Report summaries alongside plots and, when appropriate, separately by formulation or time region. A single pooled number can conceal opposing patterns.

Worked Example: Calculating Residual Error Summaries

For five hypothetical observations, suppose the residuals in fraction units are \(-0.02,\ 0.01,\ 0.03,\ -0.04,\ 0.02\). Their sum is zero, so the mean error is \(0/5=0\). This does not mean the model predicts every observation exactly.

The absolute residuals sum to \(0.02+0.01+0.03+0.04+0.02=0.12\). Therefore, \(\text{MAE}=0.12/5=0.024\), equivalent to an average absolute discrepancy of 2.4 percentage points.

The squared residuals sum to \(0.0004+0.0001+0.0009+0.0016+0.0004=0.0034\). Thus, \(\text{RMSE}=\sqrt{0.0034/5}=\sqrt{0.00068}=0.0261\), or 2.61 percentage points. The RMSE exceeds the MAE because squaring gives relatively greater weight to larger residuals, including the \(-0.04\) residual.

If variability changes across time or fitted values, consider plotting standardized residuals only when their standardization is justified by a stated variance model. Normalizing errors by a response or reference value can help compare scales, but the denominator must be defined and scientifically sensible. Near-zero denominators can make relative errors unstable. Do not present a normalized summary without stating exactly how it was calculated.

Assumptions, Comparisons, and Failure Modes

Residual plots are useful without assuming that every residual is independent and normally distributed. However, formal tests or reference thresholds for regression diagnostics require a model that specifies the relevant error structure. Repeated times within a formulation can be correlated; estimates of fraction absorbed may also share uncertainty from common concentration data or processing. Treating all points as independent can exaggerate the apparent amount of information.

A residual pattern can also be distorted by the response scale. Fraction absorbed is bounded, commonly between 0 and 1, so variability may change as the fitted fraction approaches a boundary. A straight-line mapping can predict outside the physically meaningful range if used carelessly. Examine whether apparent curvature or changing spread follows from the bounded scale, and assess whether the chosen model’s constraints and response scale are appropriate.

Residual diagnostics complement rather than replace other ways of comparing models. A high \(R^2\) or low pooled RMSE summarizes overall fit but can conceal time structure and formulation-specific failures. A residual plot exposes structure but does not give one summary number. A leave-one-formulation-out refit assesses sensitivity to individual formulations, but it is not the same as a dedicated assessment of internal predictive performance. These approaches answer different questions and should not be treated as interchangeable.

Common pitfall: “The mean residual is near zero, so the IVIVC is unbiased and fits well.” The mean can be near zero because early positive and late negative residuals cancel. Plot residuals against time and by formulation, and report an absolute-error summary as well as signed bias. Even then, good fit to the construction data does not by itself demonstrate predictive performance.

When a diagnostic suggests trouble, proceed in a controlled sequence: verify observations, units, and time alignment; inspect the pattern by formulation and time; assess sensitivity to influential formulations; then consider whether the selected dissolution input or mapping form is inadequate. Avoid adding complexity solely to remove a visible pattern without checking whether the change is scientifically defensible and supported by the available formulations.

1
Plot residuals in context.
Use time order, fitted response, selected dissolution input, and formulation labels; retain meaningful units and scales.
2
Locate structure and sensitivity.
Look for runs, curvature, changing spread, formulation clusters, and observations or formulations whose omission changes the fitted mapping.
3
Summarize without overclaiming.
Report signed and absolute errors, state their units, and distinguish in-sample fit diagnostics from predictive evaluation.

Check Your Understanding

Answer the questions, then compare with the brief solutions below.

  1. A residual is observed fraction absorbed minus predicted fraction absorbed. What does a residual of \(-0.06\) mean?
  2. Residuals are positive at early times and negative at late times. What does a mean residual near zero fail to reveal?
  3. Why does a large residual alone not establish that a formulation is influential?
  4. For residuals \(0.02\) and \(-0.04\), calculate the mean error, MAE, and RMSE.
  5. Why should a residual-versus-time regression not automatically be interpreted using an ordinary independent-errors test?

Solutions. (1) The model overpredicts by 0.06 fraction units, or 6 percentage points. (2) It fails to reveal the opposing time-dependent bias, because signed errors can cancel. (3) Influence depends on how much the fitted model changes when the point or formulation is omitted; predictor location and leverage matter as well as residual size. (4) Mean error is \((0.02-0.04)/2=-0.01\); MAE is \((0.02+0.04)/2=0.03\); RMSE is \(\sqrt{(0.02^2+(-0.04)^2)/2}=\sqrt{0.001}=0.0316\), all in fraction units. (5) Repeated times and shared data processing can make residuals dependent, so the independent-errors assumption may be inappropriate.