cleverly.sensitivity.tipping_gamma#

cleverly.sensitivity.tipping_gamma(result: TMLEResult, estimand: str = 'ate', *, null_hypothesis: float = 0.0, search: tuple[float, float] = (-8.0, 8.0), use_ci: bool = False, arm_gamma: Mapping[Any, float] | None = None) → float | None[source]#

The tilt at which the conclusion tips.

Returns the detected crossing with the smallest |gamma| at which the estimate (or, with use_ci=True, the confidence interval) crosses null_hypothesis. Returns None if the search detects no crossing. Reporting this single number is usually more informative than the whole curve: it converts “is MAR plausible?” into “would the unobserved outcomes have to differ by this much?”.

With arm_gamma= the number is the magnitude at which that direction tips the conclusion, which is what makes one scalar still meaningful when the arms are tilted by different amounts.

Refuses first by fit_wide_tilt_refusal, the table missingness_tilt() reads, because it searches over that same tilt. The capability row quotes the same sentence.

Refuses use_ci=True on a fit whose inference status supplies no inference, such as a selector-path CTMLE fit. Such a fit supplies no confidence limit for the search to follow. use_ci=False, the default, searches the point estimate and answers for that fit.

Parameters:
resultTMLEResult

A fitted result with missing outcomes.

estimandstr

Alias to search over.

null_hypothesisfloat

The value the conclusion is said to tip at.

searchtuple of float

Lower and upper tilt the search brackets. The pair must be increasing and contain zero. The search inspects an interior grid with extra resolution for the declared arm-specific tilt magnitudes before refining each crossing.

use_cibool

Whether to tip when the confidence limit reaches the null rather than the point estimate. Refused on a fit whose inference status supplies no inference, which reports no confidence limit.

arm_gammamapping of level to float, or None

One multiplier per arm, as missingness_tilt() accepts.

Returns:
float or None

The nearest detected tilt at which the conclusion crosses its null, or None when the search detects no crossing.