Why Event-Time Handling Matters
A particle filter approximates a distribution over latent states by propagating particles and updating their weights with observation likelihoods. In pharmacokinetics, a scheduled bolus changes the state instantaneously, while a known infusion rate changes how the state evolves between events. These are not interchangeable operations: a bolus is a jump, whereas an infusion is an input to the dynamics over time.
The distinction becomes critical when a dose and an observation share a recorded timestamp. The observation model must use the state that corresponds to the clinical sampling convention: either just before the dose or just after it. Applying the observation likelihood to the wrong state can change the particle weights substantially, even if all propagation calculations are otherwise correct.
Assume the latent state \(X_t\) follows an SDE between event times, with known input \(u_t\):
Here \(u_t\) may contain one or more known infusion rates. At a scheduled bolus time \(t\), the state may instead jump according to a known map \(J_t\). An observation \(Y_t\), conditional on the state used by the measurement protocol, has likelihood \(g(y_t\mid X_t)\). The particle filter uses the same model components, but evaluates them particle by particle.
Representing Boluses and Infusion Inputs
For a multidimensional amount state, a bolus entering one compartment can be written \(J_t(x)=x+B D\), where \(B\) specifies the receiving compartment and \(D\) is the dose amount. The same deterministic map is applied to every particle. If dose bioavailability or another dose component is random, that is a different model: the update would need to represent that uncertainty rather than treating the dose as fully known.
A particle propagation interval should not cross a known dose time or a discontinuity in the infusion input without explicitly accounting for it. Split the interval at each such time. On each resulting interval, propagate using the input applicable there; at a bolus time, apply the jump map in the specified event order. At an observation time, evaluate the likelihood using the pre-event or post-event state required by the observation convention.
Include observation times, scheduled boluses, and known infusion start, stop, or rate-change times.
For each particle, simulate the state over an interval using the known input that applies on that interval.
At a bolus event, map each predose particle to its postdose state using \(J_t\).
Evaluate \(g(y_t\mid x)\) at the state specified by the sampling convention, then normalize the particle weights.
Event Ordering and the Observation Likelihood
A timestamp alone does not establish whether a sample was collected immediately before or after a bolus. The model must state that convention. If the observation is postdose, first propagate to \(t-\), apply \(J_t\), and then use \(g(y_t\mid J_t(X_{t-}))\). If it is predose, use \(g(y_t\mid X_{t-})\) before applying the bolus. The observation does not itself change the physical state; it changes the weights assigned to particles.
Proof. Before the observation, the postdose state is the deterministic transform \(J_t(X_{t-})\). Therefore, for any measurable set \(A\), its joint probability with the observation having value \(y\), expressed through the observation likelihood, is proportional to \(\int \mathbf{1}_{A}(J_t(x))g(y\mid J_t(x))\pi_{t-}(dx)\). The marginal likelihood is the same integral with the indicator replaced by 1. Dividing the joint expression by this positive marginal likelihood gives the displayed conditional distribution. For a predose observation, the likelihood is conditional on \(X_{t-}=x\), so the weight factor is \(g(y\mid x)\); applying \(J_t\) afterward gives the postdose distribution. \(\square\)
In a particle approximation, suppose particles \(x_{t-}^{(i)}\) have normalized predose weights \(w_{t-}^{(i)}\). For a postdose observation, compute \(x_t^{(i)}=J_t(x_{t-}^{(i)})\), then update weights in proportion to \(w_{t-}^{(i)}g(y_t\mid x_t^{(i)})\). For a predose observation, use \(w_{t-}^{(i)}g(y_t\mid x_{t-}^{(i)})\) first; the postdose particles are then obtained by applying \(J_t\). These are different updates when the observation model depends on the changed state.
Known Infusion Inputs During Propagation
A known infusion rate belongs in the propagation model on the time interval during which it is active. For example, in a one-compartment amount model with constant elimination rate \(k>0\), constant infusion rate \(R\), and additive diffusion scale \(\sigma\), consider \(dA_t=(-kA_t+R)\,dt+\sigma\,dW_t\) on an interval of length \(\Delta\). The exact transition is Gaussian:
This expression is valid for constant \(k\), \(R\), and \(\sigma\) on the interval, with \(k>0\). If the rate changes, split the propagation interval at the change and use the appropriate rate on each segment. More generally, the SDE transition method may be approximate, but it must still incorporate the known input over the correct time interval.
The stochastic integral is normally distributed with mean zero and variance \(\sigma^2\int_t^{t+\Delta}e^{-2k(t+\Delta-s)}ds =\frac{\sigma^2}{2k}(1-e^{-2k\Delta})\). The deterministic terms give the stated mean, proving the transition formula. \(\square\)
Worked Example: Weighting a Postdose Observation
Three equally weighted particles represent predose amounts \(10\), \(20\), and \(30\) mg. A known \(50\) mg bolus enters the same compartment at the observation time. The measured postdose concentration is \(7\) mg/L, the volume is \(10\) L, and the observation error is normal with standard deviation \(1\) mg/L.
The postdose amounts are \(60\), \(70\), and \(80\) mg, so the predicted concentrations are \(6\), \(7\), and \(8\) mg/L. Since all particles have the same prior weight and the normalizing density constant is common, their likelihood factors are proportional to \(\exp[-(y-\mu_i)^2/2]\). Thus the factors are \(\exp(-1/2)=0.606531\), \(\exp(0)=1\), and \(\exp(-1/2)=0.606531\). Their sum is \(2.213062\), giving normalized weights \(0.606531/2.213062=0.2741\), \(1/2.213062=0.4519\), and \(0.606531/2.213062=0.2741\). The middle particle receives the largest weight because its postdose prediction matches the observation.
Worked Example: Propagating with an Active Infusion
Suppose \(A_t=20\) mg, \(k=0.2\) per hour, \(R=10\) mg/hour, \(\sigma=2\) mg per square-root hour, and \(\Delta=2\) hours. The exponential factor is \(e^{-0.4}=0.670320\). The transition mean is \(0.670320(20)+(10/0.2)(1-0.670320)=13.4064+16.4840=29.8904\) mg.
The transition variance is \((4/0.4)(1-e^{-0.8})=10(1-0.449329)=5.50671\) mg squared, with standard deviation \(\sqrt{5.50671}=2.34664\) mg. If three propagation draws use standard-normal values \(-1,0,1\), the resulting amounts are \(29.8904-2.34664=27.5438\), \(29.8904\), and \(29.8904+2.34664=32.2370\) mg. Omitting the infusion would instead give mean \(e^{-0.4}(20)=13.4064\) mg, a large and systematic discrepancy.
Worked Example: Why a Coincident Timestamp Needs a Convention
Use the same three equally weighted predose amounts \(10\), \(20\), and \(30\) mg, but suppose the dose is \(50\) mg, the volume is \(10\) L, and the observed concentration is \(7\) mg/L with error standard deviation \(1\) mg/L. If the sample is postdose, the calculation in the previous example gives weights \(0.2741\), \(0.4519\), and \(0.2741\).
If the sample is instead predose, the predicted concentrations are \(1\), \(2\), and \(3\) mg/L. The likelihood factors, omitting their common normal density constant, are \(\exp(-18)=1.5230\times10^{-8}\), \(\exp(-12.5)=3.7267\times10^{-6}\), and \(\exp(-8)=0.000335463\). Their sum is approximately \(0.000339205\). The normalized weights are therefore approximately \(0.0000449\), \(0.010986\), and \(0.988969\). The predose likelihood strongly favors the largest predose amount, whereas the postdose likelihood favors the middle particle. Neither answer can be selected from the timestamp alone; it depends on which state the sample represents.
Diagnostics, Alternatives, and Limitations
Several checks help detect event-time errors before interpreting a filtered trajectory:
- Check the state jump. For a known bolus entering an amount compartment, every postdose particle should differ from its corresponding predose particle by the specified dose amount, subject to the model’s dose map.
- Check interval inputs. Verify that each propagation interval uses the infusion rate active on that interval. A rate change should split the interval, not be applied retrospectively or ignored.
- Check the likelihood state. Confirm whether the observation is predose or postdose and inspect the predicted measurement for a few particles on both sides of the event.
- Check weights and units. Normalize nonnegative weights to sum to one, and ensure that dose amount, volume, concentration, infusion rate, and time units are compatible.
A common mistake is to say, “The dose and sample have the same timestamp, so the dose can be applied either before or after weighting.” That is wrong whenever the observation likelihood depends on a state changed by the bolus. The correction is to define the sampling convention and evaluate the likelihood at the corresponding state. A second frequent mistake is to treat the start of an infusion as a bolus; a rate change alters subsequent drift but does not instantaneously add the infused amount.
An alternative implementation may use an augmented event model that explicitly records pre-event and post-event states, or may encode dosing as a deterministic transition before each observation update. Either is suitable if it preserves the same event ordering and likelihood. A continuous-time propagation method can also handle the known input directly, but it must represent discontinuities and bolus jumps explicitly. The simple interval-splitting approach is transparent and often easier to audit.
These rules assume dose times, dose amounts, infusion inputs, and the relevant observation convention are known. Uncertain administration times, missed doses, or uncertain delivered amounts require additional latent variables or an expanded model. Likewise, an approximate transition method can introduce propagation error even when event handling is correct. Correct ordering prevents one class of error; it does not guarantee that the SDE transition approximation or the observation model is adequate.
Check Your Understanding
Answer each question, then compare with the brief solutions.
- A \(25\) mg bolus enters an amount compartment at time \(t\). Write the jump map for a predose amount \(A_{t-}\).
- An infusion rate changes at time \(t\), but no bolus is given. Does the state jump at \(t\)? What should happen in particle propagation?
- Predose particles have amounts \(5\) and \(15\) mg. A \(20\) mg bolus is given at the observation time. The sample is postdose and volume is \(5\) L. What concentrations should be passed to the observation likelihood?
- Why can the same recorded timestamp produce different particle weights under predose and postdose sampling conventions?
Solutions. (1) \(A_t=J_t(A_{t-})=A_{t-}+25\) mg. (2) No instantaneous state jump is implied by a rate change; split propagation at \(t\) and use the old rate before \(t\) and the new rate afterward. (3) The postdose amounts are \(25\) and \(35\) mg, so the concentrations are \(25/5=5\) and \(35/5=7\) mg/L. (4) A bolus changes the state used in the likelihood. Predose weighting evaluates \(g(y_t\mid X_{t-})\), while postdose weighting evaluates \(g(y_t\mid J_t(X_{t-}))\); those likelihood factors generally differ.