Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Efficient Sequential Recalculation of Risk

Dynamic Prediction · Tutorial 532 of 697

Efficient Sequential Recalculation of Risk

Learn to update posterior weights and recalculate conditional risk efficiently when new biomarker and event-free follow-up information become available.

Advanced 11 min read

What You'll Learn

  • Define the patient-specific posterior conditional on biomarker history and survival to a landmark.
  • Derive the sequential weight update for a new measurement and event-free interval.
  • Reuse quadrature or Monte Carlo nodes to update posterior summaries and future risk.
  • Compute conditional risk from the updated posterior and survival ratios.
  • Diagnose unstable importance weights and recognize when a full recalculation is preferable.

Why Recalculate Sequentially?

A dynamic prediction is conditional on what is known about a patient at a particular landmark time. When a new biomarker measurement arrives, the prediction should reflect both that measurement and the fact that the patient remained event-free until it was observed. Repeating every patient-specific calculation from the beginning is often unnecessary: much of the earlier integration can be reused by updating the weights attached to its quadrature nodes or simulation draws.

The reuse is exact at the level of the probability model, provided the new information is incorporated through the correct conditional likelihood. Its numerical accuracy still depends on whether the old nodes adequately represent the updated posterior. The central task is therefore twofold: derive the incremental weight and check that the existing numerical representation remains adequate.

Posterior at a Landmark and the Sequential Update

Let \(t_0\) be the previous landmark and \(t_1>t_0\) the new landmark. Write \(b_i\) for patient \(i\)'s random effects, \(\theta\) for model parameters, and \(Y_i(t)\) for the biomarker measurements observed by time \(t\). Let \(T_i\) denote event time, and let \(S_i(s\mid b_i,\theta)=P(T_i>s\mid b_i,\theta)\) be the model-based survival probability. For clarity, the patient subscript is suppressed below.

A patient-specific posterior at time \(t\) describes uncertainty about \(b\) (and, when included, \(\theta\)) conditional on the biomarker history and survival to \(t\). If \(p(\theta\mid D)\) is the parameter distribution from the fitted population model, a density proportional to this posterior is

$$ q_t(b,\theta\mid Y(t),T>t) \ \propto\ p(\theta\mid D)\,p(b\mid\theta)\,p(Y(t)\mid b,\theta)\,S(t\mid b,\theta). $$

Here \(D\) denotes the data used to fit the population model. With fixed parameter estimates, the parameter component is simply held fixed. The factor \(S(t\mid b,\theta)\) is the likelihood contribution from remaining event-free through the landmark; it makes the posterior at \(t\) different from a posterior based only on biomarker measurements.

Definition: The incremental likelihood for moving from \(t_0\) to \(t_1\) is the conditional density of the new biomarker information given the earlier history, multiplied by the conditional probability of surviving event-free through the interval. In the notation above, it is \(p(Y_{\mathrm{new}}\mid Y(t_0),b,\theta)\,S(t_1\mid b,\theta)/S(t_0\mid b,\theta)\).

The conditional biomarker density is \(p(Y_{\mathrm{new}}\mid Y(t_0),b,\theta)\). If measurement errors are conditionally independent given \(b,\theta\), this may be the ordinary density of the new observation. If the longitudinal model has correlated residuals, it must instead be the conditional density given the earlier measurements. The survival factor is a ratio because the old posterior already includes survival through \(t_0\).

Theorem: If the previous posterior is \(q_{t_0}\), then the updated posterior is proportional to \(q_{t_0}\) multiplied by the incremental likelihood. For a future horizon \(\Delta>0\), the event risk conditional on the updated information is \(1-\int \{S(t_1+\Delta\mid b,\theta)/S(t_1\mid b,\theta)\}\,q_{t_1}(b,\theta)\,db\,d\theta\).

Why the Update Formula Works

The result follows by factoring the likelihood for the enlarged history into the likelihood already used at \(t_0\) and the likelihood of information accrued afterward. In particular, conditional on \(b,\theta\), the survival contribution for being event-free at \(t_1\) can be written as the contribution through \(t_0\) times the conditional survival contribution from \(t_0\) to \(t_1\):

$$ S(t_1\mid b,\theta) = S(t_0\mid b,\theta) \frac{S(t_1\mid b,\theta)}{S(t_0\mid b,\theta)}. $$

The biomarker likelihood factors in the same way: \(p(Y(t_1)\mid b,\theta)=p(Y(t_0)\mid b,\theta)\,p(Y_{\mathrm{new}}\mid Y(t_0),b,\theta)\). Substituting both factorizations into the posterior density at \(t_1\), the factors already present in \(q_{t_0}\) cancel from the proportionality, leaving precisely the incremental likelihood stated above.

For risk, condition on a particular \(b,\theta\). Given survival through \(t_1\), the probability of surviving an additional \(\Delta\) time units is \(S(t_1+\Delta\mid b,\theta)/S(t_1\mid b,\theta)\). Averaging this conditional survival probability over the updated posterior gives the predicted survival probability; subtracting it from one gives event risk.

Reusing Numerical Integration

Suppose the earlier calculation represented \(q_{t_0}\) by nodes \((b_m,\theta_m)\) and normalized weights \(w_m\), where \(\sum_m w_m=1\). These might be quadrature nodes with associated integration weights, or Monte Carlo draws with equal or unequal weights. Define the incremental likelihood at node \(m\) as

$$ L_m = p(Y_{\mathrm{new}}\mid Y(t_0),b_m,\theta_m) \frac{S(t_1\mid b_m,\theta_m)}{S(t_0\mid b_m,\theta_m)}. $$

The updated normalized weights are \(w_m^{\mathrm{new}}=w_mL_m/\sum_k w_kL_k\). The nodes themselves can be retained, and posterior summaries can be recomputed using \(w_m^{\mathrm{new}}\). The risk calculation then becomes

$$ \widehat{R}(t_1,\Delta) = 1-\sum_m w_m^{\mathrm{new}} \frac{S(t_1+\Delta\mid b_m,\theta_m)}{S(t_1\mid b_m,\theta_m)}. $$

An equivalent calculation avoids explicitly normalizing the weights first:

$$ \widehat{R}(t_1,\Delta) = 1- \frac{\sum_m w_m L_m \{S(t_1+\Delta\mid b_m,\theta_m)/S(t_1\mid b_m,\theta_m)\}} {\sum_m w_m L_m}. $$

In practice, compute products as sums of log weights when likelihoods are very small. This reduces numerical underflow. A sequential update can save substantial computation when the original posterior integration was expensive, but it does not eliminate the need to evaluate the new measurement density and the relevant survival probabilities at each retained node.

Worked Example: Updating Two Patient-Specific Weights

Consider a hypothetical two-node approximation to a patient's posterior at \(t_0\). The weights are \(0.60\) for a lower-marker trajectory and \(0.40\) for a higher-marker trajectory. At the new landmark, the observed biomarker is \(0.8\) units. Suppose the conditional measurement densities at the two nodes are \(0.2897\) and \(0.3910\), respectively, in inverse biomarker units. The probabilities of surviving from \(t_0\) to \(t_1\) at those nodes are \(0.95\) and \(0.80\).

The unnormalized updated weights are

$$ u_1=0.60(0.2897)(0.95)=0.1651,\qquad u_2=0.40(0.3910)(0.80)=0.1251. $$

Their sum is \(0.2902\), so the normalized weights are \(0.1651/0.2902=0.5689\) and \(0.1251/0.2902=0.4311\). Both the marker observation and survival through the interval affect the update.

Suppose the conditional probabilities of surviving a further two time units, given survival to \(t_1\), are \(0.80\) and \(0.50\) at the two nodes. The predicted risk is

$$ \widehat{R} = 1-\{0.5689(0.80)+0.4311(0.50)\} = 1-(0.4551+0.2156) = 0.3293. $$

The estimated event risk over the two-unit horizon is therefore \(0.3293\), or about \(32.9\%\), under this hypothetical model and patient history. The calculation is conditional on being event-free and having the stated biomarker information at \(t_1\).

Worked Example: Applying a Second Sequential Update

Continue with the updated weights \(0.5689\) and \(0.4311\). At a later landmark, suppose a second measurement has conditional densities \(0.30\) and \(0.45\), and the probabilities of surviving the intervening period are \(0.90\) and \(0.70\). The new unnormalized weights are

$$ v_1=0.5689(0.30)(0.90)=0.1536,\qquad v_2=0.4311(0.45)(0.70)=0.1358. $$

The normalizing sum is \(0.2894\), giving weights \(0.1536/0.2894=0.5308\) and \(0.1358/0.2894=0.4692\). There is no need to reconstruct the earlier patient-specific posterior: the second update begins with the first update's weights.

If the conditional survival probabilities over the next prediction horizon are \(0.75\) and \(0.40\), the risk is \(1-\{0.5308(0.75)+0.4692(0.40)\} =1-(0.3981+0.1877)=0.4142\). Thus the updated predicted risk is \(41.4\%\) for this later landmark and horizon.

Worked Example: Checking Reused Integration Nodes

Suppose three retained integration nodes have old normalized weights \(0.20, 0.50, 0.30\). Their incremental likelihoods, each including the new measurement and survival interval, are \(0.90, 0.40, 0.10\). The unnormalized weights are \(0.180,0.200,0.030\), with sum \(0.410\). The new weights are therefore \(0.4390,0.4878,0.07317\), to four significant figures.

Suppose the conditional future survival probabilities at these nodes are \(0.90,0.60,0.20\). The averaged survival probability is \(0.4390(0.90)+0.4878(0.60)+0.07317(0.20)=0.7024\), so the estimated risk is \(1-0.7024=0.2976\), or \(29.8\%\).

The new weights are concentrated mainly on the first two nodes. Their effective sample size, a rough measure of weight concentration, is \(1/\sum_m(w_m^{\mathrm{new}})^2 =1/(0.4390^2+0.4878^2+0.07317^2)\approx2.29\) out of three nodes. This signals some concentration, though with only three nodes it is a diagnostic illustration rather than a reliable accuracy assessment.

Diagnostics, Alternatives, and Limitations

Sequential recalculation is useful because it avoids repeating calculations that remain valid under the updated model. It is especially natural for stored quadrature nodes or posterior simulation draws. A full recalculation, however, may be preferable when the updated posterior moves into a region poorly represented by the old nodes. A direct calculation from scratch can provide a useful check; in Monte Carlo work, new draws from the updated posterior may be needed if reweighting is unstable. Plugging in a single estimated random effect is faster still, but discards uncertainty about that random effect and is not equivalent to posterior integration.

Check the following before interpreting a sequential risk estimate:

  • Weight normalization: updated weights should be nonnegative and sum to one, up to rounding. Use log-scale calculations if all unnormalized weights are extremely small.
  • Weight concentration: inspect the effective sample size \(1/\sum_m(w_m^{\mathrm{new}})^2\) for normalized simulation weights, and compare it with the number of draws. A very small value means only a few draws are driving the update.
  • Survival probabilities: for each node, survival should be nonincreasing in time and lie between zero and one. A conditional survival ratio over a later interval should also lie between zero and one.
  • Risk bounds: the integrated risk must lie between zero and one. A value outside this range usually indicates a coding, normalization, or time-indexing error.
  • Incremental density: an unexpectedly tiny measurement density may indicate that the observation is poorly predicted by the model or that the density was evaluated on the wrong scale. Check units and the conditional residual model.

The update assumes that the fitted longitudinal and survival models provide the relevant conditional densities and survival probabilities. It does not repair model misspecification, omitted dependence, or inaccurate numerical integration. Reusing nodes is an approximation when those nodes are a finite numerical representation; a mathematically exact posterior update does not guarantee an accurate result from a poorly supported set of nodes.

Common pitfall: Multiplying the old weights only by the new biomarker density treats the new landmark as though the patient had no additional survival information. The correction is to multiply by the conditional survival factor \(S(t_1\mid b,\theta)/S(t_0\mid b,\theta)\) as well. Conversely, do not multiply by \(S(t_1\mid b,\theta)\) alone: survival through \(t_0\) is already represented in the old posterior.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Why does a sequential update use a survival ratio rather than the survival probability at the new landmark by itself?
  2. At two nodes, old weights are \(0.50,0.50\), and incremental likelihoods are \(0.20,0.60\). Find the normalized updated weights.
  3. Using the weights from question 2, if conditional future survival probabilities are \(0.80,0.30\), calculate the risk.
  4. Name one reason why reusing old quadrature or simulation nodes can give an unreliable update.

Solutions. (1) The old posterior already conditions on survival through \(t_0\), so the additional survival contribution is \(S(t_1\mid b,\theta)/S(t_0\mid b,\theta)\). (2) Unnormalized weights are \(0.50(0.20)=0.10\) and \(0.50(0.60)=0.30\); their sum is \(0.40\), so normalized weights are \(0.25\) and \(0.75\). (3) Averaged survival is \(0.25(0.80)+0.75(0.30)=0.425\), hence risk is \(1-0.425=0.575\), or \(57.5\%\). (4) If the updated posterior concentrates in a region not covered by the old nodes, reweighting cannot represent that region accurately; a fresh integration or simulation may be needed.

Clinical Biostats