Evaluates the two-term inverse-probability-of-censoring weighted log-loss. By default, censoring survival is estimated using marginal reverse Kaplan-Meier. Conditional or externally estimated censoring survival values can instead be supplied explicitly. Probability clipping is applied only inside logarithms.
Arguments
- time
Numeric vector of observed follow-up times.
- event
Numeric vector of event indicators (1 = event, 0 = censored).
- S_mat
A numeric matrix of predicted survival probabilities (rows = observations, columns = time points).
- times
Numeric vector of evaluation times matching the columns of
S_mat.- tmin
Numeric. Lower bound for IBS integration. Defaults to
min(times).- tmax
Numeric. Upper bound for IBS integration. Defaults to
max(times).- ipcw_floor
Positive lower bound applied to censoring survival before inversion.
- eps
Probability clipping constant in
(0, 0.5).- ipcw_cap
Largest IPCW contribution. Use
Inffor no cap.- G_T_left
Optional numeric vector containing subject-specific \(G(T_i-\mid X_i)\) values. Supply together with
G_times.- G_times
Optional numeric matrix with the dimensions of
S_matcontaining \(G(t\mid X_i)\), or a vector aligned withtimesfor a common censoring survival curve. Supply together withG_T_left.
Value
A list containing logloss_scores, integrated_logloss,
times, and diagnostics. Diagnostics report the effective
denominator threshold, intervention counts, weight quantiles, effective
sample sizes, and the fraction of weighted loss contributed by capped
rows, separately for failure and survivor terms.
