causalis.scenarios.gate.model.estimate_gate_from_irmestimate_gate_from_irm
Estimate Group Average Treatment Effects (GATEs) from a fitted IRM.
Parameters
- irm_modelfitted IRM
Interactive Regression Model with stored cross-fitted nuisance predictions , , and . The model must already be fitted.
- groupsOptional[pd.DataFrame, pd.Series, or np.ndarray]
Pre-specified subgroup definition.
- alphafloat, default 0.05
Significance level for two-sided confidence intervals.
- cov_type{“HC0”, “HC1”, “HC2”, “HC3”}, default “HC3”
Heteroskedasticity-robust covariance estimator used for subgroup inference. The implementation uses a closed-form saturated dummy-model covariance, equivalent to a no-intercept OLS regression on the GATE basis.
- cov_kwdsOptional[Dict[str, Any]], default None
Additional covariance options requested by the caller. These are currently ignored because GATE uses the closed-form HCx covariance formulas implemented in this module.
Accepted forms are:
- A single Series / one-column DataFrame of group labels.
- A multi-column dummy basis with binary indicators.
- A numpy array of group labels (assumed aligned with fit-time rows).
For strict GATE, groups must define a mutually exclusive and exhaustive
partition of the fitted sample. Each group must contain at least one
treated and one control observation.
GATE requires the fitted ``CausalData`` to define ``user_id``.
Group rows are aligned to the IRM fit-time sample using those fit-time
observation ids. In practice, ``groups.index`` must either exactly match
those ids or be a permutation of them. As a convenience, when the model
was fitted with ``user_id``, GATE also accepts groups indexed by the
original fit-time row index if the current row-to-``user_id`` mapping is
still unchanged.
If None, falls back to ``irm_model.data.gate_groups`` when present.
Returns
Result contract containing subgroup effects, standard errors, Wald statistics, confidence intervals, covariance matrix, and group-level diagnostics. The returned object also supports contrast(...) and pairwise_summary(...) for formal post-estimation group comparisons.
Examples
Notes
This implementation targets strict subgroup effects under the same unconfoundedness and overlap assumptions used by IRM, with an additional requirement that subgroup membership is pre-treatment.
Let denote a finite partition of the sample space and let be the cross-fitted doubly robust signal
For a subgroup , the target estimand is
With a mutually exclusive and exhaustive dummy basis, the estimator reduces to the groupwise sample mean of the orthogonal score:
Inference is computed from the equivalent saturated no-intercept linear regression of on the subgroup dummies. Because the design is block-diagonal, the covariance matrix is diagonal and each subgroup variance is available in closed form under HC0/HC1/HC2/HC3.
normalize_ipw=True on the IRM is intentionally ignored for GATE so the
estimator uses the canonical unnormalized orthogonal signal above.
Canonical target
causalis.scenarios.gate.model.estimate_gate_from_irm
Sections