relife.data.RenewalRewardData

relife.data.RenewalRewardData

class relife.data.RenewalRewardData(T: float, n_indices: int, n_samples: int, indices: numpy.ndarray, samples: numpy.ndarray, times: numpy.ndarray, durations: numpy.ndarray, rewards: numpy.ndarray)[source]

Bases: relife.data.RenewalData

Renewal reward process data.

Notes

Inherit from RenewalData and add a rewards attribute.

Methods

astuple

Converts the dataclass attributes as a tuple.

mean_number_of_events

Mean number of events with respect to time.

mean_total_reward

Mean total reward with respect to time.

number_of_events

Counts the number of events with respect to times.

total_reward

Total reward with respect to time.

Attributes

size

The number of indices.

rewards

Reward associated at each event.

rewards: numpy.ndarray

Reward associated at each event.

total_reward(sample: int) Tuple[numpy.ndarray, numpy.ndarray][source]

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]

mean_total_reward() Tuple[numpy.ndarray, numpy.ndarray][source]

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]

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]

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

durations: numpy.ndarray

Time between events.