NelsonAalen#
- class relife.NelsonAalen[source]#
Nelson-Aalen estimator.
Compute the non-parametric Nelson-Aalen estimator of the cumulative hazard function from lifetime data.
Notes
For a given time instant \(t\) and \(n\) total observations, this estimator is defined as:
\[\hat{H}(t) = \sum_{i: t_i \leq t} \frac{d_i}{n_i}\]where \(d_i\) is the number of failures until \(t_i\) and \(n_i\) is the number of assets at risk just prior to \(t_i\).
The variance estimation is obtained by:
\[\widehat{Var}[\hat{H}(t)] = \sum_{i: t_i \leq t} \frac{d_i}{n_i^2}\]Note that the alternative survivor function estimate:
\[\tilde{S}(t) = \exp{(-\hat{H}(t))}\]is sometimes suggested for the continuous-time case.
References
[1]Lawless, J. F. (2011). Statistical models and methods for lifetime data. John Wiley & Sons.
Methods
Cumulative hazard function.
Compute the non-parametric estimations with respect to lifetime data.
Attributes
plot
estimates
- chf(time)[source]#
Cumulative hazard function.
- Parameters:
- timenp.ndarray of shape (n, )
The times at which to estimate the cumulative hazard function.
- Returns:
- np.ndarray of shape (n, )
The estimated cumulative hazard values at each time.
- fit(time, event=None, entry=None, departure=None, inplace=False)[source]#
Compute the non-parametric estimations with respect to lifetime data.
- Parameters:
- timendarray (1d or 2d)
Observed lifetime values.
- eventndarray of boolean values (1d), default is None
Boolean indicators tagging lifetime values as right censored or complete.
- entryndarray of float (1d), default is None
Left truncations applied to lifetime values.
- departurendarray of float (1d), default is None
Right truncations applied to lifetime values.
- inplaceboolean, default is True
If true, estimations are stored in the object