Source-linked AI summary
DoWhy-GCM: An extension of DoWhy for causal inference in graphical causal models
Patrick Blöbaum, Peter Götz, Kailash Budhathoki, Atalanti A. Mastakouri, Dominik Janzing
TL;DR
DoWhy-GCM addresses causal questions beyond effect estimation by modeling graphical causal models with explicit node-level mechanisms. Its workflow uses a causal graph and observational data to fit mechanisms and pose queries, with modularity for custom models and algorithms. The supplied passages identify the need for assumptions about mechanism forms as a scope constraint.
Problem
DoWhy initially focused on effect estimation, while causal questions often extend beyond estimating an intervention’s effect on one variable.
Source: §1 · p. 1Method
DoWhy-GCM models a graph and node-level causal mechanisms, fits them from observational data, and supports diverse queries through a modular framework.
Source: §1 · pp. 1–2, §2 · p. 2Results
DoWhy-GCM adds graphical-causal-model queries including root-cause attribution, distribution-change attribution, causal-influence quantification, and counterfactual estimation.
Source: §1 · p. 1, §3 · pp. 3–4Takeaways & Limitations
A fitted GCM can be reused for different causal questions, and users can integrate custom models, algorithms, or third-party libraries.
Source: §1 · p. 2, §2 · p. 3, §5 · p. 4Explicitly modeling each node’s generating process requires assumptions about the causal mechanisms’ form.
Source: §2 · p. 2
Abstract
from arXiv · showhide
We present DoWhy-GCM, an extension of the DoWhy Python library, which leverages graphical causal models. Unlike existing causality libraries, which mainly focus on effect estimation, DoWhy-GCM addresses diverse causal queries, such as identifying the root causes of outliers and distributional changes, attributing causal influences to the data generating process of each node, or diagnosis of causal structures. With DoWhy-GCM, users typically specify cause-effect relations via a causal graph, fit causal mechanisms, and pose causal queries -- all with just a few lines of code. The general documentation is available at https://www.pywhy.org/dowhy and the DoWhy-GCM specific code at https://github.com/py-why/dowhy/tree/main/dowhy/gcm.
1 Introduction
DoWhy began with effect estimation, but causal questions often extend beyond estimating an intervention’s effect on one variable. DoWhy-GCM extends it with graphical causal models for broader causal queries, using a shared graphical structure across features to support interoperability.
1 Introduction
- DoWhy-GCM uses graphical causal models to address causal questions beyond effect estimation, complementing DoWhy’s existing focus.The graphical structure is a common data type across most features, ensuring interoperability.Source: §1 · p. 1, Figure 1 · p. 2
- The broader questions include identifying outlier root causes, attributing distributional changes to node mechanisms, quantifying causal influences, and estimating counterfactuals.Users provide a DAG and observational tabular data, fit a GCM, and pose queries.Source: §1 · p. 1
- DoWhy-GCM’s modular interfaces support custom algorithms and models, while wrappers for scikit-learn and SciPy enable parametric and non-parametric models.Users can assign a custom causal mechanism when they know a variable’s functional relationship with its parents.Source: §1 · p. 2
2 DoWhy-GCM Three-Step Recipe
DoWhy-GCM represents cause-effect relationships with a graph and node-level causal mechanisms, then fits the model and reuses it for different causal queries. Mechanism choice entails assumptions, although users can define custom mechanisms or automatically infer supported models.
2 DoWhy-GCM Three-Step Recipe
- A GCM combines a causal graph with mechanisms that model each node’s data generation given its parents; root-node distributions come from empirical data or a parametric model.Explicit node mechanisms support causal questions beyond typical effect-estimation tasks.Source: §2 · p. 2
- Users can define custom mechanisms or automatically infer them from observational data, with built-in additive noise and post non-linear models.These model classes have assumptions; in an additive noise model, the noise terms are assumed independent, and mechanisms may support noise reconstruction for counterfactual estimation.Source: §2 · pp. 2–3
- After mechanisms are assigned, users fit their parameters from data for parametric models; a ground-truth mechanism can also be supplied.The fitted GCM is then ready for causal reasoning tasks.Source: §2 · p. 3
- A fitted GCM can be reused to answer different causal questions.The recipe presents graph and mechanism specification, fitting, and querying as three successive steps.Source: §2 · pp. 2–3
3 DoWhy-GCM Features: gcm.⟨causal query⟩
With a fitted GCM, DoWhy-GCM offers query methods for attribution, model evaluation, causal influence, and what-if analysis. These methods respectively decompose observed effects, test falsifiable assumptions, quantify influence, and estimate interventions or counterfactuals.
Causal Model Evaluation
- Causal-model evaluation tests statistically falsifiable assumptions, including whether observational data can falsify a given DAG or evaluate assigned mechanisms.The listed methods are falsify_graph and evaluate_causal_model.Source: §3 · p. 3
Quantify Causal Influence
- Causal-influence methods quantify edge strength or a source node’s contribution to uncertainty in a target node.The listed methods are arrow_strength and intrinsic_causal_influence.Source: §3 · p. 3
What-If
- What-if methods estimate effects of interventions beyond standard atomic interventions and compute counterfactuals for specified interventions.The listed methods generate interventional samples and counterfactual samples for observed data.Source: §3 · p. 4
Attribution
- Attribution methods assign observed outliers or distributional changes to upstream root causes and quantify contributions from nodes, parents, mechanisms, or input features.The listed methods include anomaly attribution, distribution-change attribution, parent relevance, and unit change.Source: §3 · p. 4
4 Code design
DoWhy-GCM uses functional programming principles and common libraries to focus the API on causal questions while limiting statefulness and duplicated infrastructure.
4 Code design
- The functional API operates on a GCM and returns results, avoiding statefulness while relying on libraries such as NetworkX, NumPy, and Pandas.Defaults and convenience functions simplify use, while exposed components and models support inspection and customization.Source: §4 · p. 4
5 Discussion
DoWhy-GCM complements DoWhy’s effect-estimation features with graphical causal models, representing relationships across a system through causal mechanisms fitted to observational tabular data. Its modular API supports custom and third-party components, while algorithm scalability depends on model inference complexity, graph size, sample size, and graph structure.
5 Discussion
- DoWhy-GCM complements DoWhy’s effect-estimation features by modeling cause-effect relationships across variables with graphical causal models.This system-level view supports causal questions beyond estimating one variable’s effect on another.Source: §5 · p. 4
- Causal mechanisms represent probabilistic data-generation processes for each variable and are fitted using observational tabular data.Source: §5 · p. 4
- The modular API is designed to integrate custom models, algorithms, and third-party libraries.Source: §5 · p. 4
- Algorithm scalability depends on model inference complexity, the number of graph variables, sample size, and graph structure.Source: §5 · p. 4
- Unlike several other Python causality libraries that primarily focus on effect estimation, DoWhy-GCM offers features and algorithms that explicitly use graphical causal models.Source: §5 · p. 4