cleverly.validation.LogisticHazardOutcome#

class cleverly.validation.LogisticHazardOutcome(intercept: float = -2.0, effect: float = 0.5, adjustment_scale: float = 1.0, history_effect: float = 0.0)[source]#

Declare a discrete-time event hazard for a survival fit.

At node t a unit still at risk has the event with probability expit(intercept + f(W) + effect * d_t + history_effect * h_t). f is the standardized covariate sum of GaussianAdjustmentOutcome, and d_t is the number of treated decision nodes up to t. With effect, adjustment_scale and history_effect at 0 the hazard reads nothing, and that declaration is the independent process of dummy_outcome.

Parameters:
interceptfloat

Log-odds of the hazard at f(W) = 0 and d_t = 0.

effectfloat

Log-odds change per treated decision node.

adjustment_scalefloat

Multiplier on the standardized covariate sum.

history_effectfloat

Log-odds change 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#

LogisticHazardOutcome.probabilities(adjustment: Any, dose: Any) → ndarray[source]#

Return the event probability of 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, 1) probabilities of the one cause.

Attributes#

LogisticHazardOutcome.adjustment_scale: float = 1.0#
LogisticHazardOutcome.causes#

Return the number of absorbing causes: one.

LogisticHazardOutcome.effect: float = 0.5#
LogisticHazardOutcome.family: str = 'binomial'#
LogisticHazardOutcome.history_effect: float = 0.0#
LogisticHazardOutcome.independent#

Return whether the hazard reads neither the covariates nor the treatment.

LogisticHazardOutcome.intercept: float = -2.0#
LogisticHazardOutcome.name: str = 'logistic_hazard'#