relife.data.LifetimeData

relife.data.LifetimeData

class relife.data.LifetimeData(time: numpy.ndarray, event: Optional[numpy.ndarray] = None, entry: Optional[numpy.ndarray] = None, args: Tuple[numpy.ndarray] = ())[source]

Bases: object

Lifetime data.

Dataclass of lifetime data required by the maximum likelihood estimation.

Methods

astuple

Converts the dataclass attributes as a tuple.

Attributes

args

Extra arguments required by the lifetime model.

entry

Age of assets at the beginning of the observation period (left truncation), by default None.

event

Type of event, by default None.

time

Age of the assets.

time: numpy.ndarray

Age of the assets.

event: numpy.ndarray = None

Type of event, by default None.

entry: numpy.ndarray = None

Age of assets at the beginning of the observation period (left truncation), by default None.

args: Tuple[numpy.ndarray] = ()

Extra arguments required by the lifetime model.

class DataByEvent(D: numpy.ndarray, D_RC: numpy.ndarray, LC: numpy.ndarray, LT: numpy.ndarray)[source]

Bases: tuple

Group data by type of event.

Create new instance of DataByEvent(D, D_RC, LC, LT)

D: numpy.ndarray

observed event.

D_RC: numpy.ndarray

union of observed events and right-censored data.

LC: numpy.ndarray

left-censored data.

LT: numpy.ndarray

left-truncated data.

__add__(value, /)

Return self+value.

__mul__(value, /)

Return self*value.

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

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

Converts the dataclass attributes as a tuple.

Returns

The attributes of the class as the tuple (time, event, entry, *args).

Return type

Tuple[ndarray]