cleverly.interventions.check_support#

cleverly.interventions.check_support(regimes: RegimeSet, treatment: ndarray[tuple[Any, ...], dtype[float64]], propensity: ndarray[tuple[Any, ...], dtype[float64]], *, thresholds: tuple[float, ...] = (0.01, 0.025, 0.05), backend: str | None = None, absolute_score_weights: ndarray[tuple[Any, ...], dtype[float64]] | None = None, equations: tuple[str, ...] = (), n_repeats: int = 1) → SupportReport[source]#

Overlap diagnostics for each regime, from the untruncated mechanism.

propensity is the (n, K) mechanism as estimated, before truncation: the question this answers is what the data supports, and a bound chosen to control variance would answer it by construction.

backend names the dataframe library the fit’s data arrived in, so that SupportReport.to_frame() returns it – which is what this function’s caller already promised in prose and did not deliver. This takes arrays rather than a container, so it has to be told.

Parameters:
regimesRegimeSet

The evaluated regimes to report on.

treatmentndarray

(n,) observed treatment, in arm codes.

propensityndarray

(n, K) mechanism as estimated, before truncation.

thresholdstuple of float

Propensity levels the tail mass is reported at.

backendstr or None

Dataframe backend the fit’s data arrived in, for SupportReport.to_frame().

absolute_score_weightsndarray or None

Fitted abs(w_i * H_ij) columns, in regime order. None records an omission instead of rebuilding a possibly different equation.

equationstuple of str

Fitted score-equation names, in regime order.

n_repeatsint

Number of stored cross-fitting draws. The retained weights describe draw 1.

Returns:
SupportReport

One record per regime, plus the worst case across them.