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 t a unit still at risk has the event of cause j with probability exp(eta_j) / (1 + sum_k exp(eta_k)), where eta_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:
interceptstuple of float

One log-odds against no event per cause, in the fit’s cause order.

effectstuple of float

One log-odds change per treated decision node per cause.

adjustment_scalefloat

Multiplier on the standardized covariate sum.

history_effectfloat

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 to t. Only the longitudinal plasmode reads it, because it draws the history from frozen models and so knows its law under a regimen.

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.adjustment_scale: float = 1.0#
MultinomialHazardOutcome.causes#

Return the number of absorbing causes.

MultinomialHazardOutcome.effects: tuple[float, ...] = (0.5, 0.0)#
MultinomialHazardOutcome.family: str = 'binomial'#
MultinomialHazardOutcome.history_effect: float = 0.0#
MultinomialHazardOutcome.independent#

Return whether the hazards read neither the covariates nor the treatment.

MultinomialHazardOutcome.intercepts: tuple[float, ...] = (-2.5, -2.5)#
MultinomialHazardOutcome.name: str = 'multinomial_hazard'#