Tutorials › Pharmacokinetic-Pharmacodynamic (PK/PD) Modeling › Encoding Cumulative and Recency-Weighted Dosing History

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

Encoding Cumulative and Recency-Weighted Dosing History

Learn to construct cumulative and exponentially weighted dose histories, interpret their decay parameters, and choose and check an encoding that matches the intended PK/PD question.

Advanced 10 min read

What You'll Learn

  • Define cumulative dose from administration events and distinguish it from a recency-weighted history.
  • Derive the exponential weighting kernel and its relationship to a half-life parameter.
  • Calculate and interpret histories at a specified time, including just before and after a dose.
  • Use the recursive update for equally spaced doses and verify its assumptions.
  • Diagnose time-alignment, scaling, and interpretation problems in dose-history encodings.
  • Compare simple history summaries with lagged-dose representations and modeled drug exposure.

Why Encode Dosing History?

A dose recorded today and the same dose given weeks ago need not have the same relevance to today’s response. A history summary makes that distinction explicit: it turns a sequence of dose events into a time-varying quantity that can be linked to a PK or PD model. The summary is not automatically a concentration or a biological mechanism. It is an encoding whose assumptions determine how past doses contribute.

Two useful encodings make different assumptions. Cumulative dose gives every recorded dose equal, lasting weight. An exponentially weighted history gives older doses progressively less weight. The choice should follow the scientific question and the plausible time scale of the process, rather than convenience alone.

Definition: Let dose event \(j\) have amount \(D_j\) at time \(t_j\). At evaluation time \(t\), the cumulative-dose history is \(C(t)=\sum_{j:t_j\le t}D_j\). For decay rate \(k>0\), the exponentially weighted dose history is \(H_k(t)=\sum_{j:t_j\le t}D_j\exp[-k(t-t_j)]\). Each event contributes only after it occurs. If dose amounts are measured in mg, both summaries are measured in mg.

The inequality \(t_j\le t\) defines a right-continuous convention: a dose at time \(t\) is included in the value immediately after administration. Immediately before that event, exclude it and use \(t_j<t\). State this convention when evaluating histories near a dose time. Dose amounts must also be meaningfully comparable: summing doses given by different routes or in different formulations may not represent a coherent quantity without an appropriate conversion.

From Dose Events to an Exponential History

The exponential history applies a weight determined by the age \(a=t-t_j\) of each dose. The weight is 1 at age zero and declines toward zero as age increases. The decay rate \(k\) has units of inverse time, so \(ka\) is dimensionless. A more directly interpretable parameter is the half-life \(h\), the time required for a dose’s weight to fall to one-half. Setting \(\exp(-kh)=1/2\) gives \(k=\ln(2)/h\), so the weight can be written as \(2^{-a/h}\).

$$ H_h(t)=\sum_{j:t_j\le t}D_j\,2^{-(t-t_j)/h}, \qquad k=\frac{\ln(2)}{h}. $$

Here \(h\) is the half-life of the history weight, not necessarily the drug’s elimination half-life. Unless a mechanistic link is established, \(h\) describes how quickly the encoding discounts past doses. A longer \(h\) preserves more history; a shorter \(h\) emphasizes recent dosing.

The same history can be calculated recursively. Between dose events, \(H_k(t)\) declines at rate proportional to its current value. At a dose event, it jumps by the dose amount. To justify the between-event behavior, if no dose occurs between \(t\) and \(t+\Delta\), every dose already recorded has age increased by \(\Delta\). Thus

$$ H_k(t+\Delta)=\sum_j D_j\exp[-k(t+\Delta-t_j)] =\exp(-k\Delta)\sum_jD_j\exp[-k(t-t_j)] =\exp(-k\Delta)H_k(t). $$

At an event of amount \(D\), the post-event value is the pre-event value plus \(D\), because the new dose has weight \(\exp(0)=1\). With equally spaced observations separated by \(\Delta\), the update is therefore \(H_{\mathrm{new}}=\rho H_{\mathrm{old}}+D_{\mathrm{new}}\), where \(\rho=\exp(-k\Delta)\). For irregular time gaps, use the actual elapsed time: \(H_{\mathrm{new}}=\exp(-k\Delta)H_{\mathrm{old}}+D_{\mathrm{new}}\). The cumulative history instead updates by simply adding the new dose and does not decay between events.

Worked Example: Comparing Total Dose and Weighted History

Suppose hypothetical dose records contain 100 mg at day 0 and 50 mg at day 2. Calculate both histories immediately after day 5, using an exponential-history half-life of 3 days.

Cumulative history. Both doses have occurred, so \(C(5)=100+50=150\) mg. Their ages do not affect this total.

Weighted history. The doses are 5 and 3 days old. Using \(2^{-a/h}\),

$$ H_3(5)=100(2^{-5/3})+50(2^{-3/3}) \approx 100(0.3150)+50(0.5000) =31.50+25.00=56.50\ \text{mg}. $$

The weighted value is less than the cumulative value because both dose weights are below 1. It is not a prediction of drug mass in the body: it is the value of this particular dose-history summary.

What the Parameterization Implies

A cumulative history represents persistent accumulation: once a dose enters \(C(t)\), it remains there. This can be suitable when the hypothesis concerns total past administered amount and assumes no loss of relevance over the defined history. It can be a poor proxy when a recent dose should matter more than an old one.

An exponential history represents gradual washout in the summary. A dose’s contribution is multiplied by \(2^{-a/h}\), so after one half-life it is half its initial contribution, and after two half-lives it is one-quarter. The sum can still increase after a new dose and need not decline monotonically over time. Between doses it decays; at a dose it jumps upward.

If a PD model uses a linear effect of the history, for example \(E(t)=E_0+\beta H_h(t)\), then \(\beta\) describes the change in the modeled response per mg of weighted history, in the response units per mg. This interpretation depends on the specified model and on how the dose history is constructed. It does not establish that the history causes the response or that it captures the drug’s true concentration.

Worked Example: Updating a History Across Regular Doses

A hypothetical patient receives 10 mg immediately after each of days 0, 1, 2, 3, and 4. Calculate the exponential history immediately after the day-4 dose if \(h=2\) days, then calculate it 2 days later if no further doses occur.

The five dose ages immediately after day 4 are 4, 3, 2, 1, and 0 days. The corresponding weights are \(2^{-2}=0.2500\), \(2^{-1.5}\approx0.3536\), \(2^{-1}=0.5000\), \(2^{-0.5}\approx0.7071\), and 1. Therefore,

$$ H_2(4)=10(0.2500+0.3536+0.5000+0.7071+1) =10(2.8107)=28.11\ \text{mg}. $$

The cumulative history is \(C(4)=5(10)=50\) mg. With no intervening dose, the weighted history halves over the next 2 days: \(H_2(6)=28.11(2^{-2/2})=28.11(0.5)=14.05\) mg, using the unrounded value before rounding. The cumulative history remains 50 mg. This contrast is exactly the washout assumption built into the exponential encoding.

Assumptions, Checks, and Alternatives

A useful dose-history encoding requires more than an equation. The event times and amounts must be recorded on a consistent timeline, and the chosen history start must be appropriate: omitting earlier doses sets their contribution to zero, whether or not they could still matter. The decay form further assumes that each dose’s contribution follows the same exponential weight, independent of dose size and of other doses. The weighted sum is additive, so it does not itself represent saturation, dose-dependent decay, or a distinct effect of each dose.

Check the implementation at event boundaries, over dose-free intervals, and against a direct sum for a small set of events. Histories should not include future doses. A dose should cause a jump of exactly its amount in both \(C(t)\) and \(H_k(t)\) under the stated convention. Between events, \(C(t)\) should be constant and \(H_k(t)\) should be multiplied by \(\exp(-k\Delta)\). These checks can uncover swapped time units, a wrong sign in the exponent, or accidental inclusion of a dose before it occurred.

The half-life parameterization makes interpretation straightforward, but estimation or comparison of different \(h\) values can be sensitive to the observed follow-up and dose schedule. If all doses occur close together, the data may provide little information about how strongly old doses should be discounted. Also, \(C(t)\) and \(H_h(t)\) can be highly correlated over a limited observation period; a model may then struggle to distinguish their effects. Inspect the resulting histories over the actual analysis timeline and consider whether their changes are sufficiently different to support the intended interpretation.

These summaries are alternatives to representing dose effects with separate lagged-dose terms, as in distributed-lag effects. A finite lag structure can give distinct weights to particular time delays, whereas the exponential summary imposes a smooth, one-parameter decay pattern. A modeled concentration is a different alternative: it uses a PK model to translate dosing into predicted exposure under its structural and parameter assumptions. Neither a cumulative total nor an exponential history should be called concentration without that modeling basis.

Worked Example: Calculating the Half-Life Parameterization Correctly

Suppose hypothetical doses of 30 mg and 20 mg were given on days 0 and 4, respectively. Find the cumulative and weighted histories immediately after day 10, using \(h=5\) days.

The dose ages are 10 and 6 days. The cumulative history is \(C(10)=30+20=50\) mg. For the weighted history, the weights are \(2^{-10/5}=0.2500\) and \(2^{-6/5}\approx0.4353\). Thus,

$$ H_5(10)=30(0.2500)+20(0.4353) =7.500+8.706=16.206\ \text{mg} \approx16.21\ \text{mg}. $$

Using unrounded weights gives approximately 16.2055 mg, which also rounds to 16.21 mg. The weighted history is much smaller than the cumulative total because both doses are several days old relative to the 5-day half-life.

Common Mistakes and Practical Interpretation

  • Treating cumulative dose as current exposure. The sum \(C(t)\) records administered amounts; it does not include absorption, distribution, or elimination.
  • Calling \(h\) the drug half-life by default. It is the half-life of the chosen history weight. Equating it with a PK half-life requires a separate scientific justification.
  • Using the wrong time units. If \(h\) is in days, dose ages must also be in days. Otherwise the exponent and the resulting weights are wrong.
  • Ignoring event timing. Including a dose at its event time is a post-dose convention. A pre-dose prediction must exclude that event.
  • Assuming weighted history always decreases. It decays only between events; a new dose increases it by its dose amount.
  • Reading an association as a mechanism. A relationship between the summary and response does not show that the encoded history is the biological driver. Check whether its assumptions and timing are plausible.
Key takeaway: Cumulative dose encodes equal, permanent contribution from all included doses. An exponential history encodes decreasing contribution with dose age, controlled by a decay rate or half-life. Both are summaries; their meaning depends on the event record, time alignment, and assumptions used to construct them.

Check Your Understanding

Answer each question, then compare with the worked solutions below.

  1. A 40 mg dose is given at day 0. What are its cumulative and weighted contributions at day 6 if \(h=3\) days?
  2. For an exponential history with \(k=0.20\) per day, what fraction of a dose’s weight remains after 5 days?
  3. With equal dose intervals \(\Delta\), state the recursive update for the weighted history and explain the meaning of \(\rho\).
  4. Why is a cumulative dose of 100 mg not necessarily equivalent to a weighted history of 100 mg?

Solutions. (1) The cumulative contribution remains 40 mg. The weighted contribution is \(40(2^{-6/3})=40(0.25)=10.00\) mg. (2) The remaining fraction is \(\exp(-0.20\times5)=\exp(-1)\approx0.3679\), or 36.79%. (3) The update is \(H_{\mathrm{new}}=\rho H_{\mathrm{old}}+D_{\mathrm{new}}\), with \(\rho=\exp(-k\Delta)\), the fraction of the previous history retained over the interval. (4) The cumulative value gives every included dose full weight, whereas the weighted value discounts doses according to their ages; equal numerical values can arise from different histories and do not imply equal exposure or biological effect.

Clinical Biostats