Causal discovery with endogenous context variables

Wiebke Günther, Oana-Iuliana Popescu, Martin Rabel, Urmi Ninad, Andreas Gerhardus, Jakob Runge

Introduction

In many complex systems—ranging from Earth’s climate to genomics—the causal relationships between variables are not static. Instead, they change based on the state of the system, often referred to as a context or regime. For example, in soil science, moisture levels act as a context: in dry soil, heat flux strongly influences moisture through a feedback loop, but in wet soil, this specific interaction may disappear.

Traditional causal discovery (CD) algorithms typically assume that these context variables are exogenous (external and independent). However, in reality, the context is often endogenous—it is influenced by other variables within the system (e.g., precipitation makes dry soil wet). This paper introduces a novel algorithm, PC-AC (Adaptive Context), designed to recover context-specific causal structures when the "rules of the game" change from within the system itself.

The Challenge: Selection Bias vs. Information Loss

When dealing with context-dependent data, researchers often face a dilemma between two suboptimal approaches:

  1. Masking (Context-Specific Analysis): By looking only at data from a single context, researchers inadvertently introduce selection bias. If the context variable is a "collider" (influenced by two other variables), conditioning on it creates spurious correlations that do not reflect actual causal links.
  2. Pooling: By combining all data across all contexts, researchers avoid selection bias but lose the ability to identify relationships that are specific to a particular regime. This leads to a "blurred" graph that misses the nuances of the system's physical mechanisms.

PC-AC aims to find the "Goldilocks" zone: discovering context-specific information while avoiding the trap of selection bias.

The PC-AC Algorithm

The authors propose an extension of the classic PC algorithm that utilizes a smart decision rule for conditional independence (CI) testing. The core innovation is the Adaptive Testing Strategy.

Adaptive Testing

Instead of consistently using a single context or the entire dataset, the algorithm evaluates the "separating set" (the variables being conditioned on) for each test.

  • If the context variable $R$ is part of the separating set, the algorithm runs the test on context-specific data.
  • If $R$ is not part of the set, it uses the pooled data.

This strategy ensures that the algorithm only conditions on the context variable when theoretically necessary to resolve a specific edge, thereby minimizing the risk of collider-induced bias while maximizing the sample size for other tests.

Theoretical Framework

To bridge the gap between observed data and underlying mechanisms, the authors define three distinct graphical objects:

  • Union Graph: A master graph containing all possible edges across all contexts.
  • Descriptive Graph: The statistical dependencies observed in the data for a specific context.
  • Physical Graph: The true underlying physical mechanisms active in a specific context.

By formalizing "Regime Sufficiency" assumptions, the authors provide a hierarchy (Strong, Single-Graph, and Weak Context-Sufficiency) that allows for the sound recovery of these graphs.

Experimental Evaluation

The researchers evaluated PC-AC using synthetic datasets generated from Structural Causal Models (SCMs). These models started with a base linear acyclic structure and were "edited" (adding, removing, or flipping edges) to simulate different regimes. The experiments varied the number of nodes ($N=6, 8, 12$), graph density, and the number of changing links.

Key Results

PC-AC was compared against three baselines: PC-M (Masking), PC-P (Pooled), and PC-B (Intersection-based).

  • False Positive Rate (FPR): PC-AC significantly outperformed the masking approach. While PC-M suffered from high FPR due to selection bias, PC-AC maintained low false positives, comparable to the pooled approach.
  • True Positive Rate (TPR): PC-AC successfully recovered context-specific edges—such as the feedback loops in the soil moisture example—that the pooled approach completely failed to detect.
  • Robustness: The method proved effective even with imbalanced data (where one context has significantly more samples than another) and in the presence of small cycles.

Discussion and Future Work

PC-AC represents a significant step forward in making causal discovery applicable to dynamic, real-world systems. By prioritizing soundness over completeness, the authors prove that under the "Single-Graph-Sufficiency" assumption, the edges identified by the algorithm represent real physical changes rather than statistical artifacts.

However, several challenges remain for future research:

  • Large Cycles: The algorithm currently struggles with loops involving more than two edges in the union graph, which can lead to the context variable being misidentified.
  • Orientation Rules: While the algorithm is excellent at skeleton discovery (finding connections), fully orienting the direction of all edges using context-specific information is still being refined.
  • Hidden Confounders: The current framework assumes causal sufficiency, a condition rarely met in complex real-world datasets where unobserved variables may influence the system.
  • Dynamical Systems: Extending this theory to full time-series data, where cycles often represent time-delayed feedbacks, remains a primary goal.

Summary updated

BibTeX
@inproceedings{gunther2024causal,
  author = {Wiebke Günther and Oana-Iuliana Popescu and Martin Rabel and Urmi Ninad and Andreas Gerhardus and Jakob Runge},
  title = {{Causal discovery with endogenous context variables}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=cU8d7LeOyx},
}
Figure