Skip to content

Sensitivity

Sensitivity analysis modules.

BanditPropensitySensitivity

Bandit sensitivity analysis using multiplicative propensity bounds.

Estimand

Policy value under bounded confounding.

Assumptions: Bounded confounding and overlap in logged propensities. Inputs: estimand: PolicyValueEstimand for the target policy. Outputs: SensitivityCurve with lower and upper bounds. Failure modes: Bounds are heuristic and may be conservative or loose.

curve(data, gammas)

Compute a robustness curve over gamma values.

Inputs

data: LoggedBanditDataset with propensities. gammas: Array of gamma values >= 1.

Outputs: SensitivityCurve with lower and upper bounds per gamma. Failure modes: Raises ValueError for invalid gamma values.

GammaSensitivityModel dataclass

Gamma sensitivity model for confounded sequential OPE.

adjustments(returns)

Compute multiplicative adjustments for lower/upper bounds.

SensitivityBounds dataclass

Sensitivity bounds for bandit policy value.

SensitivityCurve dataclass

Sensitivity curve output for robustness analysis.

Estimand

Policy value under bounded propensity perturbations.

Assumptions: Bounded confounding via multiplicative propensity shifts. Inputs: gammas: Array of gamma values. lower: Lower bound array. upper: Upper bound array. metadata: Optional metadata. Outputs: Sensitivity curve with lower/upper bounds. Failure modes: None.

to_dict()

Return a dictionary representation.

confounded_ope_bounds(dataset, policy, gammas)

Compute sensitivity bounds over gamma values for trajectories.

sensitivity_bounds(dataset, policy, gammas)

Compute multiplicative propensity sensitivity bounds.