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

  1. Prune the SCM to the ancestral variables of the target, intervention, and evidence when possible.
  2. For a continuous condition C=c, simulate background variables and parents, solve for the dedicated error U_C by binary search or analytic inversion, weight samples by the transformation density, resample, and resimulate descendants.
  3. For a discrete condition, resample simulated rows satisfying C=c.
  4. For multiple evidence variables, process conditions in topological order, preserving already fixed ancestors and evidence variables.
  5. To simulate the counterfactual, run the multi-condition sampler for C=c, replace the structural functions for X with constants, and simulate the intervened SCM from the updated background-variable rows.
  6. 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.