cleverly.datasets.point_survival_truth#
- cleverly.datasets.point_survival_truth(assign: Callable[[int, int], Sequence[float]], *, arms: int = 2, causes: int = 1, n_times: int = 5, time_varying: bool = False, dose: str | None = None, continuous_event_time: bool = False, grid: Sequence[float] | None = None, end_of_study: bool = False, weight: Callable[[int, int], float] | None = None, hazard_scale: Mapping[int, float] | None = None) ndarray[tuple[Any, ...], dtype[float64]][source]#
The exact truth of
make_point_survival()under an intervention on \(A\).- Parameters:
- assign
callable() assign(w1, w2)returns the intervention’s probability of each treatment level, in level order. A static arm is one-hot, a rule is one-hot by covariate, a stochastic policy is a density, and a modified treatment policy is the law of the shifted treatment.- arms{2, 3}
The number of arms, as for
make_point_survival().- causes{1, 2}
The number of causes.
- n_times
int The number of nodes.
- time_varyingbool
Whether
L_kenters the hazard.- dose{“discrete”}
orNone "discrete"for the dose on0..5.- continuous_event_timebool
Whether the event time is exponential.
- gridsequence
offloatorNone The grid of the continuous event time.
- end_of_studybool
Whether the outcome is one
Yafter the censoring nodes.- weight
callable()orNone weight(w1, w2), an observation weight of the baseline stratum. The truth is then the parameter of the tilted law \(dP_w = w\,dP / E[w]\).Noneis no tilt.- hazard_scale
mappingofinttofloatorNone A factor on the all-cause hazard at each listed node, as for
make_point_survival().
- assign
- Returns:
ndarray(n_times, causes): the cumulative risk, or the incidence of each cause, at each node. On an end-of-study draw, a one-element array holding the mean outcome.