API#

This section provides comprehensive details about the exposed ReLife API. ReLife is structured into different modules, each with a clear and specific role. We divided the API documentation close to the same logic.

ParametricModel

Base class for ReLife models with parameters.

MaximumLikelihoodOptimizer

Abstract generic class for maximum-likelihood estimation.

Lifetime models#

Parametric lifetime models#

Parametric lifetime distributions

Exponential

Exponential lifetime distribution.

Weibull

Weibull lifetime distribution.

Gompertz

Gompertz lifetime distribution.

Gamma

Gamma lifetime distribution.

LogLogistic

Log-logistic probability distribution.

EquilibriumDistribution

Equilibrium distribution.

MinimumDistribution

Series structure of n identical and independent components.

Parametric lifetime regressions

ParametricProportionalHazard

Proportional Hazard regression.

ParametricAcceleratedFailureTime

Accelerated failure time regression.

Semiparametric lifetime regression#

SemiParametricProportionalHazard

Cox semi-parametric proportional hazard.

Non parametric lifetime models#

KaplanMeier

Kaplan-Meier estimator.

NelsonAalen

Nelson-Aalen estimator.

ECDF

Empirical Cumulative Distribution Function.

Stochastic processes#

RenewalProcess

Renewal process.

RenewalRewardProcess

Renewal reward process.

NonHomogeneousPoissonProcess

Non-homogeneous Poisson process.

Maintenance policies#

AgeReplacementPolicy

Age replacement renewal policy.

OneCycleAgeReplacementPolicy

One-cycle age replacement policy.

RunToFailurePolicy

Run-to-failure renewal policy.

OneCycleRunToFailurePolicy

One-cycle run-to-failure policy.

NonHomogeneousPoissonAgeReplacementPolicy

Age replacement policy for non-homogeneous Poisson processes.

Built-in datasets#

load_circuit_breaker

Load example dataset of circuit breaker lifetimes.

load_insulator_string

Load example dataset of insulator string lifetimes with covariates.

load_power_transformer

Load example dataset of power transformers lifetimes.

Quadratures#

Quadratures are used a many computations. We don’t use Scipy quadrature implementations as, to our knowledge, they don’t support automatic broadcasting of 2D bounds.

legendre_quadrature

Numerical integration of \(f(x)\) over the interval \([a,b]\)

laguerre_quadrature

Numerical integration of \(f(x) * exp(-x)\) over the interval \([a, \infty]\).

unweighted_laguerre_quadrature

Numerical integration of \(f(x)\) over the interval \([a, \infty]\)

Typing#

CovarTs

Generic variadic type variable tuple used for additional model arguments, such as covariates.

CoercibleFloat64_ND

Scalar or NumPy array coercible to np.float64.

CoercibleFloat64_1D

Scalar or one-dimensional NumPy array coercible to np.float64.

Float64_ND

Scalar np.float64 or NumPy array with dtype np.float64.

Float64_1D

Scalar np.float64 or one-dimensional NumPy array with dtype np.float64.

Timeline

One-dimensional timeline array with dtype np.float64.

Seed

Accepted random seed inputs.