relife.replacement_policy.RunToFailure
relife.replacement_policy.RunToFailure¶
- class relife.replacement_policy.RunToFailure(model: relife.model.AbsolutelyContinuousLifetimeModel, args: Tuple[numpy.ndarray, ...] = (), a0: Optional[numpy.ndarray] = None, cf: Optional[numpy.ndarray] = None, rate: numpy.ndarray = 0)[source]¶
Bases:
object
Run-to-failure renewal policy.
Run-to-failure renwal policy.
Renewal reward process where assets are replaced on failure with costs cf.
- Parameters
model (AbsolutelyContinuousLifetimeModel) – Absolutely continuous lifetime model of the asset.
args (Tuple[ndarray,...], optional) – Extra arguments required by the lifetime model, by default ().
a0 (float or 2D array, optional) – Current ages of the assets, by default 0 for each asset.
cf (float, 2D array or 3D array, optional) – Costs of failures, by default None.
rate (float, 2D array or 3D array, optional) – Discount rate, by default 0.
Notes
If cf is set to None, if should be defined when using methods to compute costs.
If cf and rate are 2D or 3D array, then:
axis=-2 represents the indices of each asset,
axis=-3 represents the indices of each component of the cost vector.
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 asymptotic expected equivalent annual cost.
The asymptotic expected total cost.
The expected equivalent annual cost.
The expected total discounted cost.
Arguments of the underlying renewal reward process.
Run-to-failure renewal policy sampling.
Attributes
Exponential discounting.
The failure cost of the asset.
- reward: relife.reward.FailureCost = <relife.reward.FailureCost object>¶
The failure cost of the asset.
- discount: relife.discounting.ExponentialDiscounting = <relife.discounting.ExponentialDiscounting object>¶
Exponential discounting.
- rrp_args(cf: Optional[numpy.ndarray] = None, rate: Optional[numpy.ndarray] = None) Tuple[Tuple[numpy.ndarray, ...], ...] [source]¶
Arguments of the underlying renewal reward process.
- Parameters
cf (float, 2D array or 3D array, optional) – Costs of failures, by default None.
rate (float, 2D array or 3D array, optional) – Discount rate, by default None.
- Returns
(model_args, reward_args, model1_args, reward1_args, discount_args)
- Return type
Tuple[Tuple[ndarray,…],…]
Notes
If an argument is None, the value of the class attribute is taken.
- expected_total_cost(t: numpy.ndarray, cf: Optional[numpy.ndarray] = None, rate: Optional[numpy.ndarray] = None) numpy.ndarray [source]¶
The expected total discounted cost.
The expected total discounted cost is computed by solving the renewal equation.
- Parameters
t (1D array) – Timeline.
cf (float, 2D array or 3D array, optional) – Costs of failures, by default None.
rate (float, 2D array or 3D array, optional) – Discount rate, by default None.
- Returns
The cumulative expected total cost for each asset along the timeline.
- Return type
ndarray
Notes
If an argument is None, the value of the class attribute is taken.
- asymptotic_expected_total_cost(cf: Optional[numpy.ndarray] = None, rate: Optional[numpy.ndarray] = None) numpy.ndarray [source]¶
The asymptotic expected total cost.
- Parameters
cf (float, 2D array or 3D array, optional) – Costs of failures, by default None.
rate (float, 2D array or 3D array, optional) – Discount rate, by default None.
- Returns
The asymptotic expected total cost for each asset.
- Return type
ndarray
Notes
If an argument is None, the value of the class attribute is taken.
- expected_equivalent_annual_cost(t: numpy.ndarray, cf: Optional[numpy.ndarray] = None, rate: Optional[numpy.ndarray] = None) numpy.ndarray [source]¶
The expected equivalent annual cost.
where \(z\) is the expected total cost.
- Parameters
t (1D array) – Timeline.
cf (float, 2D array or 3D array, optional) – Costs of failures, by default None.
rate (float, 2D array or 3D array, optional) – Discount rate, by default None.
- Returns
The expected equivalent annual cost for each asset along the timeline.
- Return type
ndarray
Notes
If an argument is None, the value of the class attribute is taken.
The expected equivalent annual cost at time \(t\) is:
\[EEAC(t) = \dfrac{\delta z(t)}{1 - e^{-\delta t}}\]
- asymptotic_expected_equivalent_annual_cost(cf: Optional[numpy.ndarray] = None, rate: Optional[numpy.ndarray] = None) numpy.ndarray [source]¶
The asymptotic expected equivalent annual cost.
- Parameters
cf (float, 2D array or 3D array, optional) – Costs of failures, by default None.
rate (float, 2D array or 3D array, optional) – Discount rate, by default None.
- Returns
The asymptotic expected equivalent annual cost for each asset.
- Return type
ndarray
Notes
If an argument is None, the value of the class attribute is taken.
The asymptotic expected equivalent annual cost is:
\[EEAC_\infty = \lim_{t \to \infty} EEAC(t)\]
- sample(T: float, cf: Optional[numpy.ndarray] = None, rate: Optional[numpy.ndarray] = None, n_samples: int = 1, random_state: Optional[int] = None) relife.data.ReplacementPolicyData [source]¶
Run-to-failure renewal policy sampling.
- Parameters
T (float) – End of the observation period.
cf (float, 2D array or 3D array, optional) – Costs of failures, by default None.
rate (float, 2D array or 3D array, optional) – Discount rate, by default None.
n_samples (int, optional) – Number of samples, by default 1.
random_state (int, optional) – Random seed, by default None.
- Returns
Samples of replacement times, durations, costs and events for each asset.
- Return type
Notes
If an argument is None, the value of the class attribute is taken.