Counterfactual reasoning is a formal method for causal inference that answers interventional 'what if' questions by manipulating a structural causal model. It involves constructing a hypothetical world where a specific antecedent variable is altered (e.g., 'What if the treatment had not been administered?') and using the model's causal laws to predict the new outcome. This process, formalized by do-calculus, is distinct from purely correlational or observational analysis, as it requires an understanding of the underlying data-generating mechanisms. It is foundational for tasks like root cause analysis, evaluating policy interventions, and generating contrastive explanations.
