Calculates the area under a survival curve up to the last observed time point using the composite trapezoidal rule. The result equals the restricted mean survival time (RMST) when the input curve has been evaluated on a sufficiently fine grid.
Details
The trapezoidal approximation is: $$\text{RMST} \approx \sum_{i=1}^{n-1} (t_{i+1} - t_i) \cdot \frac{S(t_i) + S(t_{i+1})}{2}.$$ For uniform grids this simplifies to: $$\Delta t \cdot \Bigl[\tfrac{1}{2}S(t_0) + S(t_1) + \cdots + S(t_{n-2}) + \tfrac{1}{2}S(t_{n-1})\Bigr].$$
