Counterfactual Particle Filtering
Context
Karvanen2024 - Simulating Counterfactuals turns counterfactual inference in a known recursive SCM into a simulation problem. The technical obstacle is the first counterfactual step: updating the background-variable distribution by factual evidence, especially when the evidence contains continuous variables.
Formal Statement
Given a recursive SCM M=(V,U,F,p(u)), evidence C=c, intervention do(X=x), target variables W, and a requested sample size n, the algorithm approximates samples from:
For continuous conditioning variables, the paper assumes u-monotonicity with respect to a dedicated error term U_C, so the equation
has at most one solution for u_C for each sampled parent context. Under bounded particle-filter potential functions, the resulting sequential Monte Carlo estimate has mean-square error of order 1/n for bounded test functions and satisfies a central-limit theorem.
Derivation / Construction
- Prune the SCM to the ancestral variables of the target, intervention, and evidence when possible.
- For a continuous condition
C=c, simulate background variables and parents, solve for the dedicated errorU_Cby binary search or analytic inversion, weight samples by the transformation density, resample, and resimulate descendants. - For a discrete condition, resample simulated rows satisfying
C=c. - For multiple evidence variables, process conditions in topological order, preserving already fixed ancestors and evidence variables.
- To simulate the counterfactual, run the multi-condition sampler for
C=c, replace the structural functions forXwith constants, and simulate the intervened SCM from the updated background-variable rows. - For fairness auditing, repeat the counterfactual simulation over sensitive-variable values while holding selected non-sensitive parents fixed, then compare the prediction-model outputs.
Implications
- Counterfactual simulation can be made algorithmic without requiring closed-form counterfactual distributions.
- The method clarifies the cost of strong causal assumptions: known structural equations and background-variable distributions are doing real work.
- Particle degeneracy is a practical warning sign when many conditions are imposed, because repeated resampling can reduce sample diversity.
- Fairness claims based on this method are causal-model-relative, not purely data-driven or prediction-model-relative.