cleverly.validation.MultinomialHazardOutcome#
- class cleverly.validation.MultinomialHazardOutcome(intercepts: tuple[float, ...] = (-2.5, -2.5), effects: tuple[float, ...] = (0.5, 0.0), adjustment_scale: float = 1.0, history_effect: float = 0.0)[source]#
Declare cause-specific discrete-time hazards for a competing-risk fit.
At node
ta unit still at risk has the event of causejwith probabilityexp(eta_j) / (1 + sum_k exp(eta_k)), whereeta_j = intercepts[j] + f(W) + effects[j] * d_t + history_effect * h_t. The probabilities of no event and of each cause sum to 1 at every node. Independent per-cause logistic hazards could sum above 1, so this catalog has none.- Parameters:
- intercepts
tupleoffloat One log-odds against no event per cause, in the fit’s cause order.
- effects
tupleoffloat One log-odds change per treated decision node per cause.
- adjustment_scale
float Multiplier on the standardized covariate sum.
- history_effect
float Log-odds change of every cause per unit of
h_t, the root-count normalized standardized sum of the time-varying columns of nodes 1 tot. Only the longitudinal plasmode reads it, because it draws the history from frozen models and so knows its law under a regimen.
- intercepts
Methods#
- MultinomialHazardOutcome.probabilities(adjustment: Any, dose: Any) ndarray[source]#
Return the probability of each cause for each unit at one node.
- Parameters:
- adjustmentarray_like
f(W)for each unit.- dosearray_like
Treated decision nodes up to this node, for each unit.
- Returns:
ndarray(n, J)cause probabilities. Each row sums to at most 1, and the rest is the probability of no event.
Attributes#
- MultinomialHazardOutcome.causes#
Return the number of absorbing causes.
- MultinomialHazardOutcome.independent#
Return whether the hazards read neither the covariates nor the treatment.