Counterfactual law of one unit (abduction, action, prediction)
Source:R/intervene.R
gmm_counterfactual.RdComputes the per-unit counterfactual of a query coordinate (the outcome)
for an observed unit, under a do() intervention – Pearl's third rung on
the latent-class structural causal model read off a fitted Gaussian
mixture.
Arguments
- g
- evidence
A length-
pnumeric vector of the observed unit. Unobserved coordinates areNA; thequerycoordinate must be observed.- do
A length-
pnumeric vector. Intervened coordinates take their counterfactual value; the rest areNA. Intervened coordinates must be observed inevidence.- query
A single integer coordinate index in
seq_len(p)– the outcome whose counterfactual is sought.- ridge_eps
Tiny ridge added to the conditioning covariances for numerical hygiene.
Value
A gmm_counterfactual_law object carrying the K atoms, their
abduction weights, and the identified counterfactual mean.
Details
The three steps are closed form. Abduction recovers the regime posterior
\(\pi_k(\text{evidence})\) of the observed unit and, within each
component, its structural residual. Action sets the do coordinates.
Prediction re-evaluates the query coordinate. For a binary treatment the
result is a discrete law on K atoms,
$$Y_{t'} \mid (y, t, x) = \sum_k \pi_k(y, t, x)\,
\delta\!\big(y + \beta_k^{T}(t' - t)\big),$$
where \(\beta_k^T\) is component k's within-class treatment slope. Only
the mean of this law is identified; its spread reflects regime
uncertainty, not the (unidentified) cross-world coupling, so the variance
and tail accessors refuse to answer (see gmm_cf_variance()).
See also
gmm_intervene(), gmm_cf_variance(), proxy_retrospective_uplift()
Other operators:
gmm_affine(),
gmm_aggregate(),
gmm_convolve(),
gmm_filter(),
gmm_intervene(),
gmm_missing(),
gmm_mix(),
gmm_observe(),
gmm_product(),
gmm_reduce()
Other decision:
fit_uplift(),
gmm_cf_mean(),
gmm_cf_tail_prob(),
gmm_cf_variance(),
gmm_intervene(),
proxy_cate(),
proxy_confounding_gap(),
proxy_decide(),
proxy_identification_report(),
proxy_overlap(),
proxy_policy_value(),
proxy_predict(),
proxy_regime_segments(),
proxy_retrospective_uplift(),
proxy_uplift(),
uplift_identification(),
uplift_model()