RunToFailurePolicy#
- class relife.policies.RunToFailurePolicy(lifetime_model, cf, discounting_rate=0.0)[source]#
Run-to-failure renewal policy.
Asset is replaced upon failure with cost \(c_f\).
- Parameters:
- lifetime_modelany lifetime distribution or frozen lifetime model
A lifetime model representing the durations between events.
- cffloat or 1darray
Costs of failures
- discounting_ratefloat, default is 0.
The discounting rate value used in the exponential discounting function
- Attributes:
- cf
References
[1]Van der Weide, J. A. M., & Van Noortwijk, J. M. (2008). Renewal theory with exponential and hyperbolic discounting. Probability in the Engineering and Informational Sciences, 22(1), 53-74.
Methods
The asymtotic expected equivalent annual cost.
The asymtotic expected net present value.
The expected equivalent annual cost.
The expected net present value.
Cost of failure.
Renewal data sampling.
set_cf- asymptotic_expected_equivalent_annual_cost(a0=None)[source]#
The asymtotic expected equivalent annual cost.
\[\lim_{t\to\infty} q(t)\]- Parameters:
- a0float or np.ndarray, optional
Initial ages of the assets.
- Returns:
- ndarray
The asymptotic expected values.
- asymptotic_expected_net_present_value(a0=None)[source]#
The asymtotic expected net present value.
\[\lim_{t\to\infty} z(t)\]- Parameters:
- a0float or np.ndarray, optional
Initial ages of the assets.
- Returns:
- ndarray
The asymptotic expected values.
- expected_equivalent_annual_cost(tf, nb_steps, a0=None)[source]#
The expected equivalent annual cost.
\[q(t) = \dfrac{\delta z(t)}{1 - e^{-\delta t}}\]where :
\(t\) is the time.
\(z(t)\) is the expected net present value at time \(t\).
\(\delta\) is the discounting rate.
- Parameters:
- tffloat
The final time.
- nb_stepsint
The number of steps used to discretized the time.
- a0float or np.ndarray, optional
Initial ages of the assets.
- Returns:
- tuple of two ndarrays
A tuple containing the timeline and the computed values.
- expected_net_present_value(tf, nb_steps, a0=None)[source]#
The expected net present value.
\[z(t) = \mathbb{E}(Z_t) = \int_{0}^{\infty}\mathbb{E}(Z_t~|~X_1 = x)dF(x)\]where :
\(t\) is the time
\(X_1 \sim F\) is the random lifetime of the first asset
\(Z_t\) are the random costs at each time \(t\)
\(\delta\) is the discounting rate
It is computed by solving the renewal equation.
- Parameters:
- tffloat
The final time.
- nb_stepsint
The number of steps used to discretized the time.
- a0float or np.ndarray, optional
Initial ages of the assets.
- Returns:
- tuple of two ndarrays
A tuple containing the timeline and the computed values.
- get_cf()#
Cost of failure.
- Returns:
- np.ndarray
- sample(nb_samples, time_window, a0=None, seed=None)[source]#
Renewal data sampling.
This function will sample data and encapsulate them in an object.
- Parameters:
- nb_samplesint
The size of the desired sample
- time_windowtuple of two floats
Time window in which data are sampled
- a0float or np.ndarray, optional
Initial ages of the assets.
- seedint, optional
Random seed, by default None.