tick.survival.nelson_aalen

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

Computes the Nelson-Aalen cumulative hazard rate estimation given by:

\[\Lambda{(t_{i})} = \sum_{j=1}^i \frac{d_j}{n_j}\]

where

  • \(d_j\) are the number of deaths at \(t_{j}\)

  • \(n_j\) are the number of patients alive just before \(t_{j}\)

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 Nelson-Aalen cumulative hazard rate