Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Integrating Over Future Marker Paths

Dynamic Prediction · Tutorial 537 of 697

Integrating Over Future Marker Paths

Learn why dynamic survival prediction must average survival across future latent marker paths, and how to calculate and check that average.

Advanced 12 min read

What You'll Learn

  • Define post-landmark survival conditional on a patient’s observed history and being event-free at the landmark.
  • Derive the path-specific survival calculation from the hazard and integrate it over future latent marker paths.
  • Distinguish averaging path-specific survival from exponentiating an averaged cumulative hazard.
  • Work through numerical predictions using a small set of trajectories and Monte Carlo draws.
  • Check model assumptions, numerical integration, and common sources of prediction error.

Why Future Marker Paths Matter

A dynamic prediction at landmark time \(s\) concerns a patient who has survived event-free to \(s\) and has a marker history observed through that time. If the hazard after \(s\) depends on the patient’s biomarker, then future survival depends on what the biomarker does after \(s\), not only on its value at the landmark. A single predicted marker curve can be a useful summary, but calculating survival from that curve generally does not account for uncertainty about the future latent marker path.

The target is survival over a specified horizon, conditional on the patient’s observed data and event-free status at the landmark. The prediction averages the survival that would result under each plausible future latent marker path, weighting paths according to their predictive distribution. This is different from first averaging the paths and then treating the average as if it were the patient’s actual future trajectory.

Definition: Let \(T_i\) be patient \(i\)’s event time, \(s\) a landmark, and \(u>0\) a prediction horizon. Let \(D_i(s)\) denote the patient’s observed longitudinal history through \(s\), and let \(M_i(t)\) be the latent biomarker process. The conditional survival prediction is $$ S_i(s+u\mid s)=P\{T_i>s+u\mid T_i>s,\ D_i(s)\}. $$ A prediction that integrates over future marker paths averages the path-specific survival from \(s\) to \(s+u\) over the predictive distribution of those paths, conditional on the observed history and survival to \(s\).

Path-Specific Survival and Its Average

Suppose, for illustration, that the event hazard conditional on the latent marker path and other patient characteristics has the form

$$ h_i(t\mid b_i,M_i(t),X_i(t)) = h_0(t)\exp\{\gamma^\mathsf{T}X_i(t)+\alpha M_i(t)\}, $$

where \(h_0(t)\) is a baseline hazard, \(X_i(t)\) denotes covariates, \(b_i\) represents latent patient-specific effects that may enter the hazard or marker model, and \(\alpha\) is the marker association parameter. Conditional on \(b_i\), the future marker path, and the covariate path, the cumulative hazard over the prediction interval is the integral of this hazard. The corresponding conditional survival is the exponential of the negative cumulative hazard:

$$ S_i(s+u\mid s,b_i,M_i,X_i) = \exp\left\{ -\int_s^{s+u} h_0(v)\exp\{\gamma^\mathsf{T}X_i(v)+\alpha M_i(v)\}\,dv \right\}. $$

The desired prediction averages this quantity over the conditional predictive distribution of \(b_i\) and the future marker path. Write \(G_i\) for that distribution given \(D_i(s)\) and \(T_i>s\). Then

$$ S_i(s+u\mid s) = \int \exp\left\{ -\int_s^{s+u}h_i(v\mid b_i,M_i(v),X_i(v))\,dv \right\} \,dG_i(b_i,M_i). $$

The distribution \(G_i\) must represent the patient’s information at the landmark. In particular, it is conditional on the observed marker history and on the patient having remained event-free through \(s\). In a joint model, survival to \(s\) can provide information about latent effects and the marker history, so those quantities should not automatically be treated as if they were distributed only according to the longitudinal model. One may construct \(G_i\) from the joint model’s conditional distribution, or use a posterior sample that already conditions on the landmark information; survival to \(s\) must not be counted twice.

Assumptions: The calculation requires a correctly specified hazard conditional on the latent marker path and included covariates; a predictive distribution for future latent paths conditional on the available landmark data; and a valid conditional survival formula given those paths. It also presumes that censoring and observation processes have been handled in a way appropriate to the joint model. If uncertain future covariates also affect the hazard, they must be conditioned on or included in the integration rather than silently fixed at an inappropriate value.

Why Averaging Survival Is Not Plugging in an Average Path

For a particular future path, let \(H\) denote its cumulative hazard over the prediction interval. Its survival is \(\exp(-H)\). Across uncertain paths, the required survival is \(E\{\exp(-H)\mid D_i(s),T_i>s\}\), not \(\exp[-E\{H\mid D_i(s),T_i>s\}]\). These two expressions generally differ because exponentiation is nonlinear.

The distinction can be justified directly. For \(H\geq 0\), the function \(f(H)=\exp(-H)\) has second derivative \(f''(H)=\exp(-H)>0\), so it is convex. Jensen’s inequality therefore gives

$$ E\{\exp(-H)\}\ \geq\ \exp\{-E(H)\}. $$

Thus, for the same distribution of cumulative hazards, exponentiating the average cumulative hazard typically gives lower survival (and higher event risk) than averaging path-specific survival. Equality holds when \(H\) has no variation. The inequality concerns averaging cumulative hazards; it does not say that every single-curve approximation will err in the same direction under every modeling choice.

Worked Example: Two Possible Future Paths

Suppose a hypothetical patient’s conditional predictive distribution at the landmark assigns probability \(0.60\) to a future marker path with cumulative hazard \(0.08\) over the next six months, and probability \(0.40\) to a path with cumulative hazard \(0.24\). The probabilities are already conditional on the patient’s landmark history and being event-free at the landmark.

Under the first path, survival is \(\exp(-0.08)=0.9231\). Under the second path, it is \(\exp(-0.24)=0.7866\). Integrating over the two paths gives

$$ S(s+6\mid s) = 0.60\exp(-0.08)+0.40\exp(-0.24) = 0.60(0.923116)+0.40(0.786628) = 0.8685. $$

The predicted six-month event risk is \(1-0.8685=0.1315\), or about \(13.15\%\). For comparison, the mean cumulative hazard is \(0.60(0.08)+0.40(0.24)=0.144\). Exponentiating that mean gives \(\exp(-0.144)=0.8659\), which is not the integrated survival. The difference here is small, but it is not zero.

Calculating Cumulative Hazard Along a Marker Path

A marker path need not be summarized by one value over the whole prediction window. If the marker varies over time, its changing values affect the hazard inside the integral. Numerical integration may be needed even after a path has been generated. For a piecewise-constant path and a constant baseline hazard, the integral reduces to a sum of interval-specific hazards multiplied by interval lengths.

Worked Example: A Piecewise-Constant Marker Path

Consider a hypothetical two-month prediction interval. Let the baseline hazard be constant at \(0.02\) per month, let \(X_i(t)=0\), and let \(\alpha=\log(2)\) per marker unit. Under one possible path, the latent marker is \(1\) during month one and \(2\) during month two. The hazard in month one is \(0.02\exp\{\log(2)\times1\}=0.04\) per month; in month two it is \(0.02\exp\{\log(2)\times2\}=0.08\) per month. Thus,

$$ H_A=(0.04)(1)+(0.08)(1)=0.12, \qquad S_A=\exp(-0.12)=0.8869. $$

A second possible path has marker values \(0\) and \(1\) over the two months. Its hazards are \(0.02\) and \(0.04\) per month, so \(H_B=(0.02)(1)+(0.04)(1)=0.06\) and \(S_B=\exp(-0.06)=0.9418\). Suppose the conditional path probabilities are \(0.70\) for path A and \(0.30\) for path B. The integrated prediction is

$$ S(s+2\mid s) = 0.70(0.886920)+0.30(0.941765) = 0.9034. $$

The corresponding two-month event risk is \(1-0.9034=0.09663\), or about \(9.663\%\). All hazards here are expressed per month and each segment lasts one month, so the cumulative hazards are dimensionless. The calculation uses the marker value within each segment; replacing the two values on each path with a single endpoint value would generally change its cumulative hazard.

Numerical Integration With Predictive Draws

In realistic models, the future path distribution is not a two-path table. A practical approach is to draw \(K\) plausible latent effects and future marker paths from the conditional predictive distribution at the landmark. For each draw, numerically integrate the hazard and calculate the path-specific survival. The average of those survival values estimates the desired integral:

$$ \widehat S_i(s+u\mid s) = \frac{1}{K}\sum_{k=1}^{K} \exp\left\{ -\int_s^{s+u}h_i(v\mid b_i^{(k)},M_i^{(k)}(v),X_i^{(k)}(v))\,dv \right\}. $$

This is a Monte Carlo approximation to the conditional expectation. Each draw must be generated from the right distribution for the target: future paths compatible with the observed history and event-free landmark status. The model’s fitted parameters are held fixed in this calculation; variation across paths represents latent-path predictive variation, not every possible source of uncertainty in the fitted model.

Worked Example: Averaging Four Predictive Draws

Suppose four equally weighted hypothetical draws from a patient’s conditional future-path distribution produce cumulative hazards \(0.05\), \(0.10\), \(0.20\), and \(0.30\). Their path-specific survival values are \(\exp(-0.05)=0.9512\), \(\exp(-0.10)=0.9048\), \(\exp(-0.20)=0.8187\), and \(\exp(-0.30)=0.7408\). The Monte Carlo estimate is

$$ \widehat S = \frac{0.951229+0.904837+0.818731+0.740818}{4} = 0.8539. $$

The estimated event risk is \(1-0.8539=0.1461\), or \(14.61\%\). The average cumulative hazard in these draws is \((0.05+0.10+0.20+0.30)/4=0.1625\). Exponentiating it gives \(\exp(-0.1625)=0.8500\), not \(0.8539\). With only four draws, the integrated estimate may also be imprecise as a numerical approximation; more draws and checks of stability are needed in an actual analysis.

Computation, Comparisons, and Diagnostics

There are several ways to approximate the same path integral. Deterministic quadrature can work well when the relevant latent distribution has low dimension and an appropriate quadrature rule is available. Monte Carlo sampling is flexible for complex or high-dimensional paths, while simulation methods can also preserve temporal dependence between successive marker values. Regardless of the integration method, the order of operations remains the same: obtain a path, integrate its hazard over time, exponentiate the negative cumulative hazard, and only then average across paths.

ApproachWhat is calculatedMain caution
Integrate over future pathsAverage path-specific survival using the conditional distribution of future latent marker pathsRequires a suitable path model and adequate numerical integration
Use one predicted marker curveCalculate survival using a single representative trajectoryCan miss variation across plausible paths; usually not equal to the integrated prediction
Average cumulative hazards firstExponentiate the negative mean cumulative hazardApplies the nonlinear survival transformation in the wrong order for an average over paths

Useful diagnostics focus on both the predictive distribution and the numerical calculation. Check that simulated paths reproduce the observed marker history in a way consistent with the fitted longitudinal model, and inspect whether their future values and temporal patterns are plausible under that model. Verify that the hazard is evaluated at the intended time points and that integration over time is sufficiently accurate. For Monte Carlo, increase the number of draws and compare estimates across independent batches or seeds; substantial movement in the prediction indicates inadequate numerical precision. Also check that all path weights are nonnegative and sum to one, that computed cumulative hazards are nonnegative, and that survival lies between zero and one.

A frequent mistake is to use the predicted mean marker curve and describe the resulting survival as if it were integrated over future marker uncertainty. That is not what the calculation does: it produces survival conditional on one curve. The correction is to generate or otherwise represent multiple plausible future paths, calculate survival separately for each, and average those survivals using the appropriate conditional weights. Another failure is to sample paths conditional on observed marker values but ignore that the patient is known to have survived to the landmark. The prediction target explicitly conditions on \(T_i>s\), so the latent distribution used for prediction must respect that information.

Path integration is only as credible as its component models. A misspecified longitudinal model can generate implausible future marker trajectories; a misspecified hazard association can map reasonable paths to poor survival predictions. Extrapolation becomes especially fragile when the prediction horizon extends far beyond the observed history or into regions of marker values with little support. These limitations are not repaired merely by increasing the number of integration draws: more computation reduces numerical error, not model error.

Key takeaway: Dynamic survival with a future time-varying latent marker is an expectation of path-specific survival. Integrate the hazard along each plausible path, transform that cumulative hazard to survival, and average the resulting survivals over paths conditional on the landmark information.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Two conditional future paths have probabilities \(0.25\) and \(0.75\), with cumulative hazards \(0.10\) and \(0.20\). Calculate integrated survival and the event risk.
  2. Why is exponentiating the mean cumulative hazard generally not the same as averaging path-specific survival?
  3. With baseline hazard \(0.03\) per month and \(\alpha=\log(2)\), a marker is constant at \(1\) for two months. Calculate the path-specific cumulative hazard and survival, assuming no other covariates.
  4. Name two checks that can reveal a problem with numerical integration or the future-path distribution.

Solutions. (1) \(S=0.25\exp(-0.10)+0.75\exp(-0.20)=0.25(0.904837)+0.75(0.818731)=0.8403\). Thus event risk is \(1-0.8403=0.1597\), or \(15.97\%\). (2) The survival transformation is nonlinear. Since \(\exp(-H)\) is convex, averaging it over variable \(H\) generally differs from applying it to \(E(H)\). (3) The hazard is \(0.03\exp\{\log(2)\}=0.06\) per month. Over two months, \(H=(0.06)(2)=0.12\), so survival is \(\exp(-0.12)=0.8869\). (4) Examples include increasing the number of simulation draws and comparing estimates across batches; checking that paths reproduce the observed history plausibly; and checking that numerical integration is stable as its time grid is refined.

Clinical Biostats