cleverly.sensitivity.ConfounderStrengthGrid#

class cleverly.sensitivity.ConfounderStrengthGrid(treatment: tuple[float, ...] | tuple[tuple[str, tuple[float, ...]], ...], outcome: tuple[float, ...])[source]#

Declare treatment and outcome perturbation strengths.

Parameters:
treatmenttuple of float, or mapping of str to tuple of float

Treatment perturbation strengths. Continuous-treatment values are signed linear coefficients. Binary-treatment values are checked as flip probabilities from zero through 0.5 when the surface runs. A vector treatment takes a mapping from each component column to its strengths, read by that component’s law, and the surface evaluates every combination. The mapping is stored as (column, strengths) pairs in the declared order.

outcometuple of float

Outcome perturbation strengths. Gaussian strengths are signed. Binomial strengths are checked as flip probabilities when the surface runs.

Attributes:
componentstuple of str

The component columns of a per-component grid, or () for one axis.

treatment_pointstuple

Every treatment strength the surface evaluates, in grid order.

See also

simulated_confounding

Evaluate the declared strength pairs.

Methods#

Attributes#

ConfounderStrengthGrid.components#

The component columns of a per-component grid, or () for one axis.

ConfounderStrengthGrid.treatment_points#

Every treatment strength the surface evaluates, in grid order.

One float per value of a one-axis grid. A per-component grid gives one tuple per combination, in the order of components.

ConfounderStrengthGrid.treatment: tuple[float, ...] | tuple[tuple[str, tuple[float, ...]], ...]#
ConfounderStrengthGrid.outcome: tuple[float, ...]#