Why an Integral Is Not a Sum of Visits
Cumulative exposure in a joint model describes the marker level accumulated over time, not the total of the measurements recorded. That distinction matters whenever visits are irregularly spaced or measurements contain error. A patient measured more often should not automatically contribute more exposure merely because more values were recorded.
The target is the area under the subject-specific latent trajectory, the underlying marker path represented by the longitudinal model. Observed marker values are noisy measurements taken at selected times. Summing those values ignores the time between visits; even weighting them to approximate an area can retain measurement error and numerical approximation error.
A standard longitudinal submodel represents measurements as $$ y_{ij}=m_i(t_{ij})+\epsilon_{ij}, $$ where \(t_{ij}\) is subject \(i\)'s \(j\)th visit time and \(\epsilon_{ij}\) is measurement error. One common trajectory specification is $$ m_i(t)=x_i(t)^\mathsf{T}\beta+z_i(t)^\mathsf{T}b_i, $$ where \(x_i(t)\) and \(z_i(t)\) are covariate vectors, \(\beta\) contains fixed effects, and \(b_i\) contains subject-specific random effects. For examples below, assume a correctly specified trajectory model, mean-zero measurement errors independent across visits conditional on the trajectory, and visit times that can be treated as fixed or noninformative given the modeled data. These assumptions make the distinction clear; they do not guarantee that every fitted trajectory is correct.
In a cumulative association structure, \(A_i(t)\) can enter a time-to-event hazard. The integral in that definition is over time. It is not the sum of the observed \(y_{ij}\), and it is not the separate numerical integration sometimes used to average over random effects in a likelihood. In practice, one integrates the fitted latent path, while inference must also account for uncertainty in the fitted trajectory and its parameters.
Irregular Visits: The Time Weights Matter
A raw sum gives equal weight to every recorded value, regardless of the time interval represented by that value. A time integral instead accumulates marker level across intervals. When only values at visit times are available, the trapezoidal rule is one possible numerical approximation: for adjacent visit times \(t_{ij}\) and \(t_{i,j+1}\), it treats the trajectory between them as linear and uses the interval width as a weight.
Worked Example: Two Visit Schedules on the Same Linear Trajectory
Suppose the latent marker trajectory is \(m(t)=2+t\) mg/L from week 0 through week 3. Its cumulative exposure is $$ A(3)=\int_0^3(2+t)\,dt=2(3)+\frac{3^2}{2}=6+4.5=10.5\ \text{mg/L-weeks}. $$ Assume the observed values equal the latent values at the visits, so measurement error is zero for this illustration.
With visits at weeks 0, 1, 2, and 3, the values are 2, 3, 4, and 5 mg/L. The trapezoidal calculation is $$ \frac{2+3}{2}(1)+\frac{3+4}{2}(1)+\frac{4+5}{2}(1) =2.5+3.5+4.5=10.5\ \text{mg/L-weeks}. $$
With the more widely spaced visits at weeks 0, 1.5, and 3, the values are 2, 3.5, and 5 mg/L. The calculation is $$ \frac{2+3.5}{2}(1.5)+\frac{3.5+5}{2}(1.5) =4.125+6.375=10.5\ \text{mg/L-weeks}. $$ Both schedules recover the same area because the trajectory is linear and the values are exact. The unweighted observed sums are 14 mg/L for the first schedule and 10.5 mg/L for the second. Those sums differ with the number of visits, have units of mg/L rather than mg/L-weeks, and are not cumulative exposure.
The example is deliberately favorable to the trapezoidal rule: it is exact for a linear trajectory when values are exact at the endpoints of the intervals. For a curved trajectory, a single straight segment between visits will generally not reproduce the true area. With irregular times, the widths of the intervals are essential: a long gap represents more time than a short gap.
Measurement Error Changes an Observed-Data Approximation
Even when a numerical rule is appropriate for the shape of the trajectory, using observed values in that rule introduces measurement error. The error can make one subject's computed area larger or smaller than the area under the latent trajectory. Mean-zero errors can make an approximation unbiased under additional conditions, but an individual error does not disappear simply because a formula includes time weights.
Worked Example: An Irregular Schedule With Noisy Measurements
Keep the latent trajectory \(m(t)=2+t\) mg/L on weeks 0 to 3, so its true latent exposure is 10.5 mg/L-weeks. Suppose visits occur at weeks 0, 1, and 3, and the observed values are 2.4, 2.7, and 5.6 mg/L. Their deviations from the latent values 2, 3, and 5 are respectively \(0.4\), \(-0.3\), and \(0.6\) mg/L.
The unweighted sum is \(2.4+2.7+5.6=10.7\) mg/L. It is not an area. Applying the trapezoidal rule to these observations gives $$ \frac{2.4+2.7}{2}(1)+\frac{2.7+5.6}{2}(2) =2.55+8.30=10.85\ \text{mg/L-weeks}. $$ This observed-data approximation is 0.35 mg/L-weeks above the latent exposure of 10.5 mg/L-weeks.
The difference follows directly from the trapezoid weights. For intervals of 1 and 2 weeks, the weights on the three values are \(0.5\), \(1.5\), and \(1\) weeks. The weighted measurement error is $$ 0.5(0.4)+1.5(-0.3)+1(0.6)=0.20-0.45+0.60=0.35\ \text{mg/L-weeks}. $$ Thus, even though the trapezoidal rule is exact for the underlying linear trajectory, applying it to noisy observations yields 10.5 plus the weighted measurement error, or 10.85 mg/L-weeks here.
More generally, write the trapezoidal approximation as \(\sum_{k=0}^K w_k y_{ik}\), where the weights are determined by adjacent visit intervals. Under independent errors with mean zero and common variance \(\sigma^2\), conditional on the latent trajectory and visit times, $$ E\left(\sum_{k=0}^K w_k y_{ik}\right)=\sum_{k=0}^K w_k m_i(t_k), \qquad \operatorname{Var}\left(\sum_{k=0}^K w_k y_{ik}\right)=\sigma^2\sum_{k=0}^K w_k^2. $$ The expectation is the trapezoidal approximation to the latent path, not automatically its exact integral. The variance shows that irregular intervals affect the contribution of measurement error: a visit with a larger weight can have greater influence on the observed-data area.
Integrating the Fitted Latent Trajectory
A joint model uses the longitudinal data to estimate the latent trajectory rather than treating every measurement as the trajectory itself. For a fitted trajectory \(\hat m_i(t)\), the model-based exposure is $$ \hat A_i(t)=\int_0^t \hat m_i(s)\,ds. $$ If the fitted trajectory has a form that can be integrated analytically, the integral can be evaluated directly. Otherwise, numerical integration can be applied to the fitted function over time. This is distinct from using the visit values as the only representation of the path.
Worked Example: Integrating a Curved Fitted Trajectory
Suppose a fitted latent trajectory over days 0 to 2 is \( \hat m(t)=1+0.5t+0.2t^2 \) mg/L. Assume for this calculation that this is the intended model-estimated path over the full interval. Direct integration gives $$ \hat A(2)=\int_0^2(1+0.5t+0.2t^2)\,dt =\left[t+0.25t^2+\frac{0.2}{3}t^3\right]_0^2 =2+1+\frac{1.6}{3} =3.533\ \text{mg/L-days}. $$
At days 0, 1, and 2, the fitted values are 1, 1.7, and 2.8 mg/L. Their unweighted sum is 5.5 mg/L, not an exposure. The trapezoidal approximation is $$ \frac{1+1.7}{2}(1)+\frac{1.7+2.8}{2}(1) =1.35+2.25=3.60\ \text{mg/L-days}. $$ It exceeds the model-based integral by \(3.60-3.533=0.067\) mg/L-days (approximately), because the trajectory is curved and the trapezoids replace that curve with straight segments. The model-based integral and the trapezoidal approximation target the same area, but are not numerically identical here.
Justifying the Distinction and Choosing a Calculation
The algebra explains why a raw sum cannot in general stand in for a time integral. On an interval from \(a\) to \(b\), a linear trajectory connecting endpoint values \(m(a)\) and \(m(b)\) has area equal to the interval width times its average endpoint height. Therefore, its area is \((b-a)\{m(a)+m(b)\}/2\), not \(m(a)+m(b)\). Summing this expression across intervals gives the trapezoidal rule. For a linear path, this rule is exact because each interval is represented by the path itself; for a curved path, it is an approximation.
This also clarifies the role of model-based integration. If the fitted latent path is linear, its integral can be calculated from the fitted coefficients exactly. If it is nonlinear, analytic integration or sufficiently accurate numerical quadrature can calculate the area of that fitted path. A visit-based trapezoid instead approximates the path using only selected values. The model-based integral is not automatically the true biological exposure: it remains dependent on the longitudinal model, the available follow-up, and uncertainty in its estimates.
Specify the time origin, end time, marker units, and whether the target is the latent trajectory integral \(A_i(t)\).
Use the longitudinal model to estimate \(\hat m_i(s)\) over the interval, not just at recorded visits.
Integrate the fitted function analytically when possible, or use an adequate numerical integration method when needed.
Inspect visit gaps and model fit, and account for uncertainty in the trajectory and model parameters when making inferential claims.
The calculation method should match the target and the available assumptions. An unweighted sum is appropriate only if the intended quantity is explicitly a sum of recorded values; it does not estimate area in general. A trapezoidal rule can be useful when a visit-based approximation is desired and the path is reasonably represented by straight segments between sufficiently close observations. Direct integration of the fitted trajectory is natural when cumulative exposure is defined through that model. These approaches are not interchangeable: one changes the target, while the others make different approximations to the time integral.
Diagnostics, Limitations, and a Common Pitfall
Diagnostics should focus on both the trajectory model and the integration interval. Plot observed values with the fitted latent path, looking for systematic residual patterns, unexplained curvature, or observations that the model consistently misses. Check visit gaps: a long interval requires stronger assumptions about the unobserved path than a short one. Compare analytic integration with numerical quadrature when both are available, and increase quadrature resolution to confirm that the numerical result is stable. Check that the time origin and exposure units are consistent throughout.
A model-based integral can be unreliable when the trajectory form is misspecified, measurements are too sparse to identify its shape, or substantial parts of the integration interval require extrapolation beyond observed data. If visit timing depends on unmodeled health changes, treating visit times as noninformative may also be questionable. And when \(\hat m_i(t)\) is estimated, \(\hat A_i(t)\) is estimated too: a plug-in integral alone does not express its uncertainty. Joint-model inference should propagate relevant uncertainty rather than presenting a fitted area as known without error.
Common pitfall: “Subject A had twice as many visits as subject B, so summing both subjects’ measurements gives comparable cumulative exposures.” This is wrong because the raw sum gives every visit equal weight and has marker units, not marker-times-time units. The correction is to define exposure as a time integral and use a model-based trajectory integral or an explicitly justified time-weighted approximation.
A second, subtler mistake is to assume that trapezoid weighting removes measurement error. It supplies time weights, but observed values still contain error, as the worked calculation showed. Nor does it eliminate approximation error for a curved path. The useful distinction is therefore between the target (area under the latent path), the representation (a fitted trajectory or observed points), and the calculation (analytic integration, numerical quadrature, or a visit-based rule).
Check Your Understanding
Try each problem, then compare your reasoning with the solutions below.
- A latent marker path is \(m(t)=3+2t\) mg/L over 0 to 2 weeks. Find its cumulative exposure and state the units.
- Why can an unweighted sum of observed marker values not generally be interpreted as cumulative exposure, even when all measurements are accurate?
- At times 0, 1, and 3 weeks, observed values are 2.4, 2.7, and 5.6 mg/L. Calculate their trapezoidal approximation and explain why it differs from the latent exposure of 10.5 mg/L-weeks in the corresponding example.
- For a smooth convex trajectory, why might a trapezoidal approximation over a wide interval be above the model-based integral?
Solutions. (1) \(\int_0^2(3+2t)\,dt=3(2)+[t^2]_0^2=6+4=10\) mg/L-weeks. (2) An unweighted sum assigns equal weight to visits regardless of the time intervals, and its units are mg/L rather than mg/L-weeks. (3) The interval widths are 1 and 2 weeks, so the approximation is \((2.4+2.7)(1)/2+(2.7+5.6)(2)/2=2.55+8.30=10.85\) mg/L-weeks. It exceeds 10.5 by 0.35 because the weighted measurement errors are \(0.5(0.4)+1.5(-0.3)+1(0.6)=0.35\) mg/L-weeks. (4) For a convex curve, a straight chord between endpoints lies above the curve between them; integrating that chord over the interval can therefore exceed the integral under the curve. The size and direction of the error depend on the path and interval width.