relife.data.CountData

relife.data.CountData

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

Bases: object

Counting process data.

Methods

astuple

Converts the dataclass attributes as a tuple.

mean_number_of_events

Mean number of events with respect to time.

number_of_events

Counts the number of events with respect to times.

Attributes

size

The number of indices.

T

Time at the end of the observation.

n_indices

Number of initial assets.

n_samples

Numbers of samples.

indices

Indices of assets.

samples

Indices of samples.

times

Times of observed events.

T: float

Time at the end of the observation.

n_indices: int

Number of initial assets.

n_samples: int

Numbers of samples.

indices: numpy.ndarray

Indices of assets.

samples: numpy.ndarray

Indices of samples.

times: numpy.ndarray

Times of observed events.

property size: int

The number of indices.

Returns

Size of indices array.

Return type

int

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

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]

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

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]

astuple() tuple[source]

Converts the dataclass attributes as a tuple.