cleverly.sensitivity.positivity_report#
- cleverly.sensitivity.positivity_report(result: TMLEResult) PositivityReport[source]#
Compute overlap diagnostics for a fitted TMLE.
Two arms and more than two are reported by separate functions rather than one parameterised by arm count, because the questions differ. With two arms there is one propensity and overlap is symmetric:
gnear zero andgnear one are the same problem seen from either arm, and the interesting split is treated versus control. With more there is no single margin and no mirror – each arm has its own denominator, which has to be reported and truncated in its own right. Collapsing the two into one function would mean picking definitions that read oddly in both.A continuous treatment is refused rather than given a third branch. Every field of
PositivityReportis per arm – quantiles ofg(a | W), tail mass, effective sample size, weight share – and a dose has none, so the report would come back empty with asimplex_deviationof1.0computed from a zero-column mechanism: the largest value the field can take, reported as a finding. The question a shift fit actually has to answer is about the density ratio at the shifted dose, whichcheck_policy_support()answers.- Parameters:
- result
TMLEResult A fitted result.
- result
- Returns:
PositivityReportOverlap read off the stored nuisance fits, without refitting.
- Raises:
CapabilityErrorIf the fit estimated no treatment mechanism. A missing-outcome
NaturalCourseMeanfit has no propensity for an arm-wise support report to read; inspect the missingness row ofdiagnostics.nuisance_models()instead.DataErrorIf the treatment is continuous, which has no per-arm propensity either.