Tutorials › Pharmacokinetic-Pharmacodynamic (PK/PD) Modeling › Interpolating Irregular Covariate Measurements

Time-Varying Covariates and Dosing History · Tutorial 492 of 598

Interpolating Irregular Covariate Measurements

Learn how interpolation assumptions shape covariate values between visits, and compare their consequences for response predictions and uncertainty.

Advanced 12 min read

What You'll Learn

  • Define carry-forward, linear, and model-based interpolation for irregularly timed covariate measurements.
  • Identify the assumptions each method makes about covariate behavior between visits.
  • Calculate and compare interpolated values at a time between observations.
  • Use an Ornstein–Uhlenbeck bridge as one model-based interpolation example.
  • Assess how interpolation choices affect response predictions and their uncertainty.
  • Recognize when sparse measurements, abrupt changes, or extrapolation make interpolation unreliable.

Why Interpolation Is a Modeling Choice

Covariates in a PK/PD analysis are not always measured at the same times as drug concentrations or responses. A model may need a covariate value at a time between two visits, even though the record contains measurements only at the visits themselves. Interpolation supplies a value for that unmeasured time; it does not reveal what the covariate actually was. The value depends on assumptions about how the covariate changed between measurements.

The three broad choices considered here are step-function carry-forward, linear interpolation, and model-based interpolation. They can produce different covariate histories from the same measurements and therefore different predictions from a response model. As in reconstructing analysis timelines from dosing and covariate records, first align all measurements to a consistent time origin and verify their timestamps. Interpolation cannot repair a misaligned timeline.

Definition: Suppose a covariate is observed at times \(t_0<t_1<\cdots<t_J\), with values \(x_0,x_1,\ldots,x_J\). Interpolation assigns an estimated value \(\tilde{x}(t)\) for a time \(t\) between observed times. The interpolation rule specifies how \(\tilde{x}(t)\) is obtained; it does not make \(\tilde{x}(t)\) an observed measurement.

Three Interpolation Rules

For \(t_j\leq t<t_{j+1}\), carry-forward assigns the most recent observed value to the time until the next measurement. This is a step function: it treats the covariate as constant over each interval, with an update at the next recorded measurement. It is simple and can be appropriate for a quantity that genuinely remains fixed between recorded changes, such as a documented categorical status. For a continuously varying biomarker, it is an approximation that may leave long periods at an outdated value.

$$ \tilde{x}_{\mathrm{CF}}(t)=x_j,\qquad t_j\leq t<t_{j+1}. $$

Linear interpolation joins adjacent observations by a straight line. It assumes a constant rate of change over each interval, though the rate may change from one interval to another. It matches both endpoint measurements and is continuous at measurement times, but it does not establish that the true path was linear.

$$ \tilde{x}_{\mathrm{lin}}(t) =x_j+\frac{t-t_j}{t_{j+1}-t_j}(x_{j+1}-x_j), \qquad t_j\leq t\leq t_{j+1}. $$

Model-based interpolation uses an explicit model for covariate dynamics and estimates the value between observations under that model. A model can represent smooth mean reversion, trends, or other specified dynamics, and can provide uncertainty as well as a point estimate. Its flexibility comes with assumptions and parameters that must be justified. The model-based method below uses an Ornstein–Uhlenbeck (OU) process as one precise example; it is not the only possible model.

Worked Example: Comparing Carry-Forward and Linear Interpolation

Worked Example: Comparing Carry-Forward and Linear Interpolation

Suppose a hypothetical covariate is measured at hour 0 with value 5 units and at hour 6 with value 8 units. Find its interpolated value at hour 3 under both methods. For illustration, suppose a response score at that time is predicted by the fixed relationship \(R=20-2x\), where \(R\) is in score units. This relationship is supplied only to show how the interpolation choice changes a prediction.

Carry-forward. Hour 3 is after the hour-0 measurement and before the hour-6 measurement, so the carried-forward value is \(5\) units. The corresponding score prediction is \(20-2(5)=10\) score units.

Linear interpolation. The fraction of the interval elapsed is \((3-0)/(6-0)=0.5\). Thus,

$$ \tilde{x}_{\mathrm{lin}}(3) =5+\frac{3}{6}(8-5) =5+1.5 =6.5\ \text{units}. $$

The corresponding score prediction is \(20-2(6.5)=7\) score units. The two predictions differ because the interpolation rules supply different covariate values at hour 3, not because either method has learned the unobserved value. The assumed response relationship is identical in both calculations.

Model-Based Interpolation: An OU Bridge

An OU process is a continuous-time model that fluctuates around a long-run mean \(m\), with a tendency to move back toward that mean. Write the process as

$$ dX(t)=\theta\{m-X(t)\}\,dt+\sigma\,dW(t), \qquad \theta>0,\quad \sigma>0, $$

where \(X(t)\) is the latent covariate, \(W(t)\) is Brownian motion, \(\theta\) is the mean-reversion rate, and \(\sigma\) is the process-noise scale. For an OU bridge, assume the endpoint covariate values at the beginning and end of an interval are observed without measurement error, and condition on both values. The conditional mean between those endpoints is a model-based interpolated value. This procedure assumes the OU dynamics and known values of \(m\) and \(\theta\); fitting those parameters introduces additional estimation uncertainty.

Model-based interpolation: For an OU process observed at interval endpoints \(X(0)=x_0\) and \(X(T)=x_T\), the conditional mean at \(0<t<T\) is
$$ E\{X(t)\mid X(0)=x_0,X(T)=x_T\} =m+ \frac{\sinh\{\theta(T-t)\}}{\sinh(\theta T)}(x_0-m) + \frac{\sinh(\theta t)}{\sinh(\theta T)}(x_T-m). $$

This conditional mean uses both the earlier and later endpoint values. It is therefore a retrospective interpolation rule: it cannot be calculated from the earlier measurement alone. Under the specified OU model with exact endpoints, the conditional variance is

$$ \operatorname{Var}\{X(t)\mid X(0),X(T)\} =\frac{\sigma^2}{2\theta} \frac{(1-e^{-2\theta t})(1-e^{-2\theta(T-t)})} {1-e^{-2\theta T}}. $$

The variance describes uncertainty about the latent covariate at the interior time under this model and its stated assumptions. It is not a confidence interval for a population parameter. If endpoint measurements contain error, treating them as exact is inappropriate; the model must instead distinguish the latent process from the measurement process.

Worked Example: Calculating an OU-Bridge Estimate

Worked Example: Calculating an OU-Bridge Estimate

Consider hypothetical exact endpoint values \(x_0=2\) units and \(x_T=8\) units, measured 10 days apart. Suppose the OU model has long-run mean \(m=4\) units and mean-reversion rate \(\theta=0.1\) per day. Calculate the conditional mean at day 4 and compare it with linear interpolation.

For the OU bridge, the two weights are \(\sinh\{0.1(10-4)\}/\sinh(0.1(10))=\sinh(0.6)/\sinh(1)\approx0.5417\) and \(\sinh\{0.1(4)\}/\sinh(1)=\sinh(0.4)/\sinh(1)\approx0.3495\). Therefore,

$$ \begin{aligned} \tilde{x}_{\mathrm{OU}}(4) &=4+0.5417(2-4)+0.3495(8-4)\\ &=4-1.0834+1.3980\\ &\approx4.315\ \text{units}. \end{aligned} $$

Linear interpolation gives \(2+(4/10)(8-2)=4.4\) units, while carry-forward gives \(2\) units. The OU estimate is shaped by the assumed tendency to return toward 4 units, as well as by both endpoints. Its value is not automatically more accurate: that depends on whether the OU assumptions describe the covariate adequately.

For scale, suppose also that \(\sigma=0.5\) units per square-root day. The conditional variance is approximately \((0.5^2/(2(0.1)))\{(1-e^{-0.8})(1-e^{-1.2})/(1-e^{-2})\}=0.556\) units squared, giving a conditional standard deviation of \(\sqrt{0.556}=0.746\) units. This uncertainty cautions against treating the conditional mean as a directly observed value.

Worked Example: An Irregular Schedule and a Long Gap

Worked Example: An Irregular Schedule and a Long Gap

In a hypothetical record, a covariate is measured at day 0 with value 3 units, day 4 with value 7 units, and day 11 with value 8 units. Estimate the value at day 7 using carry-forward and linear interpolation between the surrounding measurements.

Day 7 lies between days 4 and 11. Carry-forward gives 7 units. Linear interpolation uses the 7-day interval and the increase of 1 unit:

$$ \tilde{x}_{\mathrm{lin}}(7) =7+\frac{7-4}{11-4}(8-7) =7+\frac{3}{7} \approx7.429\ \text{units}. $$

The observed rate of change from day 0 to day 4 was \((7-3)/4=1\) unit per day; from day 4 to day 11 it was \((8-7)/7\approx0.143\) units per day. The difference cautions against assuming one constant rate across the entire record. It does not, by itself, prove that either interval was nonlinear: the measurements could include noise, and the unobserved path is unknown. The longer second interval also gives less direct information about the covariate at day 7 than a nearby measurement would.

Justification, Diagnostics, and Practical Consequences

The OU-bridge formula follows from Gaussian conditioning. For an OU process, \(X(t)\) is jointly normally distributed with the endpoint values. Conditional on \(X(0)=x_0\), the expected deviation from the long-run mean at time \(t\) is \(E\{X(t)-m\}=(x_0-m)e^{-\theta t}\). The conditional covariance between two times \(s\leq t\), given \(X(0)\), is \(\sigma^2 e^{-\theta(t-s)}(1-e^{-2\theta s})/(2\theta)\). For jointly normal variables, the conditional mean given \(X(T)\) is the mean given \(X(0)\), plus the covariance with \(X(T)\), divided by the conditional variance of \(X(T)\), times the difference between \(x_T\) and its conditional mean. Substituting these OU means and covariances and simplifying gives the two endpoint weights in the bridge formula. Thus the result relies on the OU process assumptions and Gaussian conditioning; it is not a generic formula for any covariate.

A practical comparison should consider what the measurements can support, what the covariate can plausibly do, and whether the analysis is retrospective or prospective. The table summarizes the central trade-offs.

MethodBehavior assumed between measurementsUses later endpoint?Main caution
Carry-forwardConstant at the last value until updatedNoCan lag changing covariates
LinearConstant rate of change within each intervalYesMay smooth over abrupt or curved changes
Model-basedDynamics follow a specified stochastic or deterministic modelOften, for smoothing or bridgingResults depend on model form and parameter estimates

Useful diagnostics begin with the measurement record. Plot observed values against time, mark visit times, and inspect interval lengths, abrupt jumps, repeated values, and potential changes in measurement scale. Check that interpolation reproduces observed endpoints where it is meant to do so, and inspect whether predicted paths are plausible on the covariate’s scale. For a model-based method, examine whether its fitted dynamics can reproduce features such as observed variability and serial dependence; a smooth-looking curve alone is not evidence of a suitable model.

Interpolation between two observations is distinct from extrapolation beyond the last observation. Carrying the last value forward past the final visit assumes continued constancy, while extending a linear segment assumes its rate of change continues. Neither assumption is supported by a later endpoint. Similarly, a bridge that conditions on a future measurement is appropriate for retrospective reconstruction but cannot be used as if that future measurement were available for a prospective prediction.

The chosen covariate path can change response predictions. If a response prediction is \(g(\tilde{x}(t))\), different interpolation rules generally produce different values of \(g\). If the covariate itself is uncertain and \(g\) is nonlinear, evaluating the response at the conditional mean covariate need not equal the mean response prediction: \(g(E[X(t)\mid\text{data}])\) need not equal \(E[g(X(t))\mid\text{data}]\). A point-interpolated covariate can therefore understate prediction uncertainty. Interpolation also does not establish that a covariate causes a response difference; it supplies a time-indexed input under an analysis choice.

A common mistake is to treat linear interpolation as neutral because it exactly connects the observed measurements. That reasoning confuses agreement at the endpoints with knowledge of the path between them. The correction is to state the method’s constant-rate assumption, assess whether it is plausible for the covariate and interval, and check whether alternative defensible assumptions materially change the prediction. When measurements are sparse, interpolation can only be as informative as the observations and assumptions allow.

1
Align and inspect.
Verify the time origin, units, measurement times, and intervals before constructing a covariate history.
2
Choose an assumption.
Use carry-forward, linear interpolation, or a specified dynamic model only when its implied behavior is scientifically defensible.
3
Check consequences.
Compare interpolated paths and resulting predictions, and retain uncertainty when a model-based method provides it.

Check Your Understanding

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

  1. A covariate is measured at day 2 with value 10 mg/L and at day 8 with value 16 mg/L. What do carry-forward and linear interpolation assign at day 5?
  2. What additional assumption does a linear interpolation make compared with carry-forward?
  3. Why can an OU-bridge estimate differ from a linear estimate even when both use the same endpoint measurements?
  4. Why is an interpolation conditioned on a later visit unsuitable for a prediction made before that visit?

Solutions. (1) Carry-forward assigns 10 mg/L. Linear interpolation gives \(10+\{(5-2)/(8-2)\}(16-10)=13\) mg/L. (2) It assumes a constant rate of change within that interval, rather than a constant value. (3) The OU bridge also uses the specified mean-reverting dynamics and long-run mean, so its conditional weights need not be the linear weights. (4) The later measurement was not available at prediction time; using it would incorporate future information and would not represent a prospective prediction.

Clinical Biostats