relife.nonparametric.ECDF

relife.nonparametric.ECDF

class relife.nonparametric.ECDF[source]

Bases: object

Empirical Cumulative Distribution Function.

Methods

fit

Fit the empirical cumuative distribution function.

plot

Plot the empirical cumulative distribution function.

fit(time: numpy.ndarray) relife.nonparametric.ECDF[source]

Fit the empirical cumuative distribution function.

Parameters

time (1D array) – Failure times.

Returns

Return the fitted empirical estimate as the current object.

Return type

ECDF

plot(alpha_ci: float = 0.05, fname: str = 'cdf', **kwargs: numpy.ndarray) None[source]

Plot the empirical cumulative distribution function.

Parameters
  • alpha_ci (float, optional) – \(\alpha\)-value to define the \(100(1-\alpha)\%\) confidence interval, by default 0.05 corresponding to the 95% confidence interval. If set to None or if the model has not been fitted, no confidence interval is plotted.

  • fname (str, optional) –

    Name of the function to be plotted, by default ‘cdf’. Should be one of:

    • ’sf’ : survival function,

    • ’cdf’: cumulative distribution function.

  • **kwargs – Extra arguments to specify the plot properties (see matplotlib.pyplot.plot documentation).

Raises

ValueError – If fname value is not ‘sf’ or ‘cdf’.