ParametricLifetimeModel#

class relife.lifetime_model.ParametricLifetimeModel(**kwparams)[source]#

Base class for lifetime model.

This class defines the structure for creating lifetime model. It is a blueprint for implementing lifetime model expecting a variadic set of arguments. It expects implemantation of hazard functions (hf), cumulative hazard functions (chf), probability density function (pdf) and survival function (sf). Other functions are implemented by default but can be overridden by derived classes.

Note:

The abstract methods also provides a default implementation. One may not have to implement hf, chf, pdf and sf and just call super() to access the base implementation.

Methods:

hf: Abstract method to compute the hazard function. chf: Abstract method to compute the cumulative hazard function. sf: Abstract method to compute the survival function. pdf: Abstract method to compute the probability density function.

Raises:

NotImplementedError: Raised when an abstract method or feature in this class has not been implemented in a derived class.

Methods

cdf

chf

hf

ichf

isf

ls_integrate

mean

median

moment

mrl

pdf

ppf

rvs

sf

var

property nb_params#

Number of parameters.

Returns:
int

Number of parameters.

property params#

Parameters values.

Returns:
ndarray

Parameters values of the core

Notes

If parameter values are not set, they are encoded as np.nan value.

Parameters can be by manually setting`params` through its setter, fitting the core if fit exists or by specifying all parameters values when the core object is initialized.

property params_names#

Parameters names.

Returns:
list of str

Parameters names

Notes

Parameters values can be requested (a.k.a. get) by their name at instance level.

property plot#

Provides access to plotting functionnalities