Why did the distribution change?

Kailash Budhathoki, Dominik Janzing, Patrick Blöbaum, Hoiyi Ng

Abstract: We describe a formal approach based on graphical causal models to identify the "root causes" of the change in the probability distribution of variables. After factorizing the joint distribution into conditional distributions of each variable, given its parents (the "causal mechanisms"), we attribute the change to changes of these causal mechanisms. This attribution analysis accounts for the fact that mechanisms often change independently and sometimes only some of them change. Through simulations, we study the performance of our distribution change attribution proposal. We then present a real-world case study identifying the drivers of the difference in the income distribution between men and women.

Introduction

In machine learning and data science, detecting "distribution shift" is a common task. However, identifying why a distribution has changed remains a significant challenge. Standard statistical tests, such as the Kolmogorov-Smirnov test or KL divergence, can signal that a shift has occurred but treat variables as a flat list, failing to disentangle the underlying structured system of cause and effect. This paper introduces a formal framework to attribute changes in a probability distribution to specific "root causes" by leveraging graphical causal models.

Methodology

The proposed approach rests on two theoretical pillars: Graphical Causal Models and Shapley values from cooperative game theory.

Causal Factorization

Using the Causal Markov Condition, the joint distribution of a system is factorized into a product of autonomous "causal mechanisms":

$$P(X_1, \dots, X_n) = \prod P(X_j | PA_j)$$

where $PA_j$ represents the direct causal parents of variable $X_j$. The principle of independent mechanisms posits that these conditional distributions are autonomous; a change in one mechanism does not necessarily imply a change in others. Root cause analysis then becomes the task of identifying which specific $P(X_j | PA_j)$ have shifted.

Attribution via Shapley Values

While changes in the joint distribution are additive across mechanisms, attributing changes in a marginal distribution (e.g., the distribution of a single target variable like "income") is more complex due to variable interactions. To address this, the authors employ Shapley values. This method fairly distributes the total observed change among the causal mechanisms by averaging the impact of changing each mechanism across all possible orderings. This ensures a mathematically principled attribution that accounts for the dependencies within the causal graph.

Experimental Evaluation

The framework was evaluated using synthetic simulations based on Linear Structural Causal Models (SCMs). The researchers compared the performance of linear regression and XGBoost in recovering ground-truth attribution values.

Performance of attribution across different sample sizes and model types.

As shown in the simulation results, the method perfectly recovers ground-truth attribution when the model class matches the underlying data (linear regression). While non-linear models like XGBoost exhibit higher initial error ($\ell_1$ distance), their accuracy improves significantly as the sample size increases, demonstrating the robustness of the attribution framework.

Case Study: The Gender Income Gap

To demonstrate real-world utility, the authors analyzed the Adult Census Income dataset to identify the drivers of the income distribution difference between men and women. The causal structure assumed for this analysis is shown below.

Causal graph for the income distribution case study.

The analysis revealed that the primary driver of the mean income gap was the change in the mechanism of occupation ($P(\text{occupation} | \text{education})$). Even when controlling for education level, the distribution of occupations differed significantly between genders. Interestingly, "Education" itself had a near-zero direct contribution to the gap; its influence was almost entirely mediated through its effects on occupation, which subsequently influenced income.

Conclusion and Limitations

This causal approach provides a systematic way to perform root cause analysis on distribution shifts. By decomposing systems into independent mechanisms, it moves beyond correlation to identify the actual "physics" of the change. However, the method's accuracy is dependent on the correctness of the provided causal graph. Additionally, calculating exact Shapley values is computationally expensive for high-dimensional systems ($2^n$), necessitating the use of approximations in larger models. Future work may focus on integrating causal discovery algorithms to automate graph construction and optimizing attribution for high-dimensional data.

Summary updated

Abstract

We describe a formal approach based on graphical causal models to identify the "root causes" of the change in the probability distribution of variables. After factorizing the joint distribution into conditional distributions of each variable, given its parents (the "causal mechanisms"), we attribute the change to changes of these causal mechanisms. This attribution analysis accounts for the fact that mechanisms often change independently and sometimes only some of them change. Through simulations, we study the performance of our distribution change attribution proposal. We then present a real-world case study identifying the drivers of the difference in the income distribution between men and women.
BibTeX
@inproceedings{budhathoki2021why,
  author = {Kailash Budhathoki and Dominik Janzing and Patrick Blöbaum and Hoiyi Ng},
  title = {{Why did the distribution change?}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=gkSnVd8Gcb},
}
Figure