relife.data.ReplacementPolicyData
relife.data.ReplacementPolicyData¶
- class relife.data.ReplacementPolicyData(T: float, n_indices: int, n_samples: int, indices: numpy.ndarray, samples: numpy.ndarray, times: numpy.ndarray, durations: numpy.ndarray, rewards: numpy.ndarray, events: numpy.ndarray, args: numpy.ndarray, a0: numpy.ndarray)[source]¶
Bases:
relife.data.RenewalRewardData
Replacement policy data.
Methods
Converts the dataclass attributes as a tuple.
Mean number of events with respect to time.
Mean total reward with respect to time.
Counts the number of events with respect to times.
Builds a lifetime data sample.
Total reward with respect to time.
Attributes
The number of indices.
Event types.
Extra arguments required by the lifetime model.
Age of the assets at the first replacement.
- events: numpy.ndarray¶
Event types.
- args: numpy.ndarray¶
Extra arguments required by the lifetime model.
- a0: numpy.ndarray¶
Age of the assets at the first replacement.
- to_lifetime_data(t0: float = 0, tf: Optional[float] = None, sample: Optional[int] = None) relife.data.LifetimeData [source]¶
Builds a lifetime data sample.
- Parameters
t0 (float, optional) – Start of the observation period, by default 0.
tf (float, optional) – End of the observation period, by default the time at the end of the observation.
sample (int, optional) – Index of the sample, by default all sample are mixed.
- Returns
The lifetime data sample built from the observation period [t0,tf] of the renewal process.
- Return type
- Raises
ValueError – if t0 is greater than tf.
- astuple() tuple ¶
Converts the dataclass attributes as a tuple.
- mean_number_of_events() Tuple[numpy.ndarray, numpy.ndarray] ¶
Mean number of events with respect to time.
- Returns
The ordered times and mean number of events as a tuple (times, counts).
- Return type
Tuple[ndarray, ndarray]
- mean_total_reward() Tuple[numpy.ndarray, numpy.ndarray] ¶
Mean total reward with respect to time.
- Returns
The ordered times and mean total rewards as a tuple (times, z).
- Return type
Tuple[ndarray, ndarray]
- number_of_events(sample: int) Tuple[numpy.ndarray, numpy.ndarray] ¶
Counts the number of events with respect to times.
- Parameters
sample (int) – Index of the sample.
- Returns
The ordered times and total number of events as a tuple (times, counts).
- Return type
Tuple[ndarray, ndarray]
- property size: int¶
The number of indices.
- Returns
Size of indices array.
- Return type
int
- total_reward(sample: int) Tuple[numpy.ndarray, numpy.ndarray] ¶
Total reward with respect to time.
- Parameters
sample (int) – Index of the sample.
- Returns
The ordered times and total rewards as a tuple (times, z).
- Return type
Tuple[ndarray, ndarray]
- rewards: numpy.ndarray¶
Reward associated at each event.