DoWhy-GCM: An Extension of DoWhy for Causal Inference in Graphical Causal Models
Patrick BlöbaumPeter GötzKailash BudhathokiAtalanti-Anastasia MastakouriDominik Janzing
Extends the DoWhy Python library with graphical causal models to perform complex causal tasks beyond standard effect estimation, including root cause analysis of outliers, distributional change attribution, and counterfactual estimation.
Modern data science increasingly requires organizations to look beyond simple correlations to understand the causal mechanisms driving complex systems. While most existing computational tools focus almost entirely on estimating the effect of an intervention, practical business and engineering questions often demand deeper insights. Organizations frequently need to pinpoint the root causes of system failures, explain unexpected distributional shifts, and evaluate complex 'what-if' counterfactual scenarios.
The article demonstrates and evaluates DoWhy-GCM, an open-source extension to the DoWhy Python library that leverages graphical causal models to answer a broad spectrum of causal questions beyond traditional effect estimation.
To achieve this, the system models an entire system as a directed causal graph where each node represents a variable with an assigned data-generating mechanism. The approach combines tabular observational data—whether continuous, discrete, or categorical—with graphical causal models grounded in formal causal theory. The framework employs a modular three-step workflow: defining the causal graph, fitting mechanism parameters automatically or with custom statistical models, and executing diverse causal queries on the fitted model.
The article highlights several core capabilities. First, the framework enables root-cause analysis by attributing system anomalies and distributional shifts directly to specific upstream components. Second, it quantifies causal influence by measuring edge strength and isolating the intrinsic contribution of individual variables to overall uncertainty. Third, it supports advanced 'what-if' reasoning, including both interventional simulations and point- or population-level counterfactual estimation. Fourth, it provides statistical falsification tools to rigorously test whether graph structures and causal mechanism assumptions align with observed data. Finally, the framework integrates seamlessly with standard data science software via a functional programming design that supports both parametric and non-parametric estimators.
These capabilities mean organizations can diagnose operational risks and anomalies much faster and more accurately by evaluating full causal pathways rather than isolated treatment effects. Incorporating automated mechanism assignment and graph falsification reduces the risk of making high-stakes decisions based on unverified structural assumptions.
Teams seeking to analyze complex system interactions should consider piloting this tool for root-cause analysis and operational diagnosis. However, stakeholders should note that computational scalability depends heavily on graph size, sample volume, and model complexity. Decisions remain contingent on the validity of the underlying causal graph and modeling assumptions, making the use of built-in falsification tests essential prior to operational deployment.
- Paper: Equivalence and Synthesis of Causal Models, Tom S. Verma et al. (1990). Verma and Pearl establish the graphical-model equivalence concepts that underpin causal graphs and make the source’s graph-based workflow easier to interpret.
- Paper: Causal structure-based root cause analysis of outliers, Kailash Budhathoki et al. (2022). This framework develops causal root-cause attribution for outliers, providing a direct methodological foundation for DoWhy-GCM’s anomaly diagnosis capabilities.
- Paper: Direct and Indirect Effects, Judea Pearl (2001). Pearl’s account of direct and indirect effects supplies the path-specific causal reasoning behind the source’s broader intervention and counterfactual queries.
- Paper: Causal-learn: Causal Discovery in Python, Yujia Zheng et al. (2024). After seeing DoWhy-GCM use causal graphs for downstream questions, causal-learn extends the workflow upstream by providing Python tools to discover those graphs from data.
- Paper: Causal Representation Learning from Multiple Distributions: A General Setting, Kun Zhang et al. (2024). This later 2024 work extends graph-based causal reasoning to identifying hidden causal representations across multiple distributions.
