tick.survival.kaplan_meier

tick.survival.kaplan_meier(timestamps, event_observed)[source]

Computes the Kaplan-Meier survival function estimation given by:

\[S{(t)} = \prod_{i:t_{(i)}<t}^n \left(1 - \frac{d_i}{n_i} \right)\]

where

  • \(d_i\) are the number of deaths at \(t_{i}\)

  • \(n_i\) are the number of patients alive just before \(t_{i}\)

Parameters

timestamps : numpy.array

Timestamps for each observation

event_observed : numpy.array

Bool array denoting if the death event was observed or not

Returns

output : numpy.array

The computed Kaplan-Meier survival function estimation