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 of every parametric models in ReLife.

Lifetime models#

Parametric lifetime models#

ParametricLifetimeModel

Base class for parametric lifetime models in ReLife.

Lifetime distributions

Exponential

Exponential lifetime distribution.

Weibull

Weibull lifetime distribution.

Gompertz

Gompertz lifetime distribution.

Gamma

Gamma lifetime distribution.

LogLogistic

Log-logistic probability distribution.

Lifetime regression

ProportionalHazard

Proportional Hazard regression.

AcceleratedFailureTime

Accelerated failure time regression.

Conditional lifetime models

LeftTruncatedModel

Left truncated model.

AgeReplacementModel

Age replacement model.

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#

Convenient functions to instanciate a policy based on the given model and cost structure.

age_replacement_policy

Creates a preventive age replacement policy.

run_to_failure_policy

Creates a run-to-failure policy.

Lower-level policy classes that can be used in addition to the above functions.

AgeReplacementPolicy

Age replacement policy.

OneCycleAgeReplacementPolicy

One-cyle age replacement policy.

RunToFailurePolicy

Run-to-failure renewal policy.

OneCycleRunToFailurePolicy

One cyle run-to-failure policy.

NonHomogeneousPoissonAgeReplacementPolicy

Age replacement policy for non-Homogeneous Poisson process.

Economy#

RunToFailureReward

Run-to-failure reward.

AgeReplacementReward

Age replacement reward.

ExponentialDiscounting

Exponential discounting.

Built-in dataset#

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.

Utils#

Various utilities to help with development.

reshape_1d_arg

Reshapes ReLife arguments that are expected to be 0d or 1d.

get_args_nb_assets

Gets the number of assets encoded in args.

is_frozen

Checks if model is frozen.

is_lifetime_model

Checks if model is a lifetime model.

is_non_homogeneous_poisson_process

Checks if model is a non-homogeneous Poisson process.

Quadrature utilities 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]\)