ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing
ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing

All Courses

Advanced Causal Inference in Machine Learning Systems
Chapter 1: Structural Causal Models and Identification Strategies
Structural Causal Models Revisited
Advanced Graphical Representations: DAGs
Do-calculus Rules and Applications
Identification Beyond Standard Criteria
Addressing Cycles and Feedback in Causal Graphs
Sensitivity Analysis for Identification Assumptions
Practice: Applying Identification Logic
Chapter 2: Advanced Causal Discovery Techniques
Constraint-based Discovery Algorithms: PC, FCI Extensions
Score-based Discovery Algorithms: GES, LiNGAM
Discovery Using Interventional Data
Causal Discovery from Heterogeneous Data
Assessing Causal Discovery Algorithm Performance
Managing Latent Variables in Discovery
Hands-on Practical: Implementing Discovery Algorithms
Chapter 3: Estimating Causal Effects in High Dimensions
Double Machine Learning for Average Treatment Effects
Causal Forests for Heterogeneous Effects
Meta-Learners for CATE Estimation
Deep Learning Approaches for Effect Estimation
Techniques for High-Dimensional Confounders
Validation and Calibration of CATE Estimators
Practice: DML and Causal Forest Implementation
Chapter 4: Confronting Unobserved Confounding and Selection Bias
Advanced Instrumental Variables (IV) Methods
Deep Learning and Kernel Methods for IV
Regression Discontinuity Designs (RDD)
Difference-in-Differences (DiD) with Panel Data
Adapting Selection Bias Correction Methods
Proximal Causal Inference Principles
Hands-on Practical: IV and RDD Analysis
Chapter 5: Causal Inference for Temporal Data and Dynamic Systems
Challenges in Causal Inference with Time Series
Granger Causality: Formulation and Shortcomings
Structural Vector Autoregression (SVAR)
Dynamic Treatment Regimes and Estimation
Time Series Causal Discovery Methods
Causal Reinforcement Learning and Off-Policy Evaluation
Practice: Temporal Causal Analysis
Chapter 6: Operationalizing Causal Inference in Machine Learning Pipelines
Causal Principles in Feature Engineering and Selection
Causality-Aware Model Development
Evaluating ML Models Using Causal Concepts
Enhancing A/B Testing with Causal Inference
Monitoring ML Systems for Causal Stability
Designing Causal Inference Components for MLOps
Hands-on Practical: Building a Causally-Informed Pipeline

Constraint-based Discovery Algorithms: PC, FCI Extensions

Constraint-based algorithms represent a foundational approach to causal discovery. They operate on the principle that the observed statistical dependencies and independencies in data reflect the underlying causal structure, assuming certain conditions hold. Specifically, these methods utilize the connection between conditional independence relationships (X⊥Y∣ZX \perp Y | ZX⊥Y∣Z) and the graphical concept of d-separation in the true causal Directed Acyclic Graph (DAG).

The core assumption underpinning most constraint-based methods is faithfulness: the idea that all conditional independence relations present in the data distribution are consequences of d-separation in the causal DAG, and conversely, all d-separations in the DAG correspond to conditional independencies in the distribution. Violations of faithfulness (e.g., exact cancellation of effects along different paths) can mislead these algorithms.

The PC Algorithm: Discovering Structure under Causal Sufficiency

The PC algorithm, named after its developers Peter Spirtes and Clark Glymour, is perhaps the most well-known constraint-based method. It operates under the significant assumption of Causal Sufficiency, meaning there are no unobserved common causes (latent confounders) influencing multiple measured variables.

The PC algorithm proceeds in two main phases:

  1. Adjacency Search (Skeleton Identification):

    • Start with a complete undirected graph where every variable is connected to every other variable.
    • Iteratively remove edges between variable pairs XXX and YYY. An edge X−YX - YX−Y is removed if a conditional independence X⊥Y∣SX \perp Y | SX⊥Y∣S is found for some subset SSS of the neighbors of XXX (excluding YYY) or the neighbors of YYY (excluding XXX).
    • The algorithm starts testing with conditioning sets SSS of size 0 (∣S∣=0|S|=0∣S∣=0). If X⊥YX \perp YX⊥Y, the edge X−YX-YX−Y is removed.
    • It then proceeds to test for conditional independence given conditioning sets of size 1 (∣S∣=1|S|=1∣S∣=1), then size 2 (∣S∣=2|S|=2∣S∣=2), and so on, up to a predefined maximum size or until no more edges can be removed. This iterative process efficiently prunes the graph.
    • The result of this phase is an undirected graph representing the causal skeleton, where remaining edges indicate direct causal connections or confounding (which is ruled out by the causal sufficiency assumption).
  2. Edge Orientation:

    • The algorithm orients edges based on the conditional independence information gathered during the adjacency search.
    • Identify V-Structures: Search for triples X−Z−YX - Z - YX−Z−Y such that XXX and YYY are not adjacent, but the edge X−ZX - ZX−Z and Z−YZ - YZ−Y were not removed. If the conditioning set SXYS_{XY}SXY​ that separated XXX and YYY (i.e., led to finding X⊥Y∣SXYX \perp Y | S_{XY}X⊥Y∣SXY​) does not contain ZZZ, orient the edges as X→Z←YX \rightarrow Z \leftarrow YX→Z←Y. This forms a v-structure (or collider) at ZZZ.
    • Apply Orientation Rules: Repeatedly apply logical rules to orient remaining edges, ensuring no new v-structures are created and no directed cycles are formed. For example:
      • If X→Y−ZX \rightarrow Y - ZX→Y−Z exists and XXX and ZZZ are not adjacent, orient Y→ZY \rightarrow ZY→Z (to avoid the v-structure X→Y←ZX \rightarrow Y \leftarrow ZX→Y←Z).
      • If X→Y→ZX \rightarrow Y \rightarrow ZX→Y→Z exists and there is an edge X−ZX - ZX−Z, orient it as X→ZX \rightarrow ZX→Z (to avoid a cycle X→Y→Z→XX \rightarrow Y \rightarrow Z \rightarrow XX→Y→Z→X).

The output of the PC algorithm is typically a Completed Partially Directed Acyclic Graph (CPDAG), which represents a Markov equivalence class of DAGs. All DAGs in this class share the same skeleton and v-structures and imply the same set of conditional independencies.

Simplified illustration of PC algorithm phases on three variables A, B, C, assuming the true structure is A -> B <- C and faithfulness holds. Step 2 shows the skeleton after testing reveals A and C are independent given B. Step 3 shows the resulting v-structure orientation.

Strengths and Limitations:

  • Strengths: Computationally efficient for sparse graphs compared to score-based methods; provides insights into conditional independence structure.
  • Limitations: Highly sensitive to errors in conditional independence tests (statistical errors with finite data, non-linear relationships); requires the strong assumption of Causal Sufficiency; output is an equivalence class, not necessarily the single true DAG. Order-dependency in standard implementations can affect results, although stable versions exist (e.g., PC-Stable).

The FCI Algorithm: Handling Latent Confounders

The assumption of Causal Sufficiency is often unrealistic in practice. Unobserved common causes (latent confounders) can induce spurious associations, leading PC to incorrect conclusions (e.g., adding spurious edges or misorienting existing ones).

The Fast Causal Inference (FCI) algorithm is a constraint-based method explicitly designed to handle the potential presence of latent confounders. It relaxes the Causal Sufficiency assumption.

Main differences from PC:

  1. Output Representation: FCI outputs a Partial Ancestral Graph (PAG). PAGs are more complex than DAGs or CPDAGs, using edge marks to represent uncertainty introduced by potential latent variables. Common edge marks include:

    • X→YX \rightarrow YX→Y: Definitely XXX causes YYY.
    • X↔YX \leftrightarrow YX↔Y: Definitely a latent confounder LLL exists such that X←L→YX \leftarrow L \rightarrow YX←L→Y.
    • X∘→YX \circ\rightarrow YX∘→Y: Either X→YX \rightarrow YX→Y or X↔YX \leftrightarrow YX↔Y.
    • X∘−∘YX \circ - \circ YX∘−∘Y: Adjacency is certain, but orientation is completely uncertain (X→YX \rightarrow YX→Y, X←YX \leftarrow YX←Y, or X↔YX \leftrightarrow YX↔Y).
    • X−YX - YX−Y: Represents adjacency established in the skeleton phase, before orientation rules resolve it further.
  2. Independence Tests: FCI requires tests for conditional independence that are reliable to selection bias potentially induced by conditioning on colliders involving latent variables. This involves more complex conditioning set selection (using "possible-D-SEP" sets).

  3. Orientation Rules: The orientation rules are significantly more involved than PC's, designed to deduce ancestral relationships (e.g., XXX is an ancestor of YYY) and the presence of confounders, even without observing them directly.

Comparison of PC and FCI outputs given a true structure with a latent confounder L between X and Y, where both X and Y cause Z. PC might infer a spurious edge or incorrect orientations. FCI correctly represents the uncertainty using PAG edge marks, indicating potential confounding (X∘−∘YX \circ - \circ YX∘−∘Y) and uncertain direct causation (X∘→ZX \circ\rightarrow ZX∘→Z, Y∘→ZY \circ\rightarrow ZY∘→Z).

Strengths and Limitations:

  • Strengths: Provides asymptotically correct results even with latent confounders (under faithfulness and test assumptions). Offers a principled way to handle missing variables.
  • Limitations: Computationally more demanding than PC. The output PAG can be complex and less interpretable than a DAG, potentially leaving many relationships unresolved. Still sensitive to statistical errors in independence tests.

Extensions and Variants

Both PC and FCI have inspired numerous extensions and variations designed to address specific limitations or improve performance:

  • PC-Stable, Conservative PC: Modifications to PC that make the skeleton identification phase independent of the order in which variables are processed, enhancing stability. Conservative PC is more cautious about removing edges when test results conflict.
  • RFCI (Really Fast Causal Inference): A variant of FCI that aims for similar robustness to latent variables but with significantly improved computational speed, particularly in the adjacency search phase. It might be slightly less informative in its orientation phase compared to standard FCI.
  • COmbINE: Integrates background knowledge (e.g., known temporal order, forbidden edges) directly into the constraint-based search process.
  • Kernel-based Tests (KCI): Replace standard conditional independence tests (like Fisher's Z or G-squared) with kernel-based measures (e.g., using Hilbert-Schmidt Independence Criterion, HSIC). These can detect non-linear relationships and handle non-Gaussian data more effectively but often come with higher computational costs.
  • Constraint-based Algorithms for Mixed Data: Extensions designed to handle datasets containing both continuous and discrete variables simultaneously.

Practical Approaches for Implementation

Applying constraint-based algorithms effectively requires careful attention to several factors:

  1. Choice of Conditional Independence Test: Select a test appropriate for your data type (e.g., Fisher-Z test for multivariate Gaussian data, Chi-squared or G-squared test for discrete data, Kernel Conditional Independence (KCI) test for non-linear continuous data). The assumptions of the chosen test must be reasonably met.
  2. Significance Level (α\alphaα): The threshold used for independence tests significantly impacts the resulting graph. A smaller α\alphaα leads to fewer edges being removed (denser graph, fewer false negatives, more false positives for independence), while a larger α\alphaα results in more edges being removed (sparser graph, more false negatives, fewer false positives for independence). Choosing α\alphaα often involves domain knowledge or model selection techniques.
  3. Computational Cost: The complexity grows rapidly with the number of variables and the density of the true graph. The maximum size of the conditioning set is a critical parameter affecting runtime. For high-dimensional data, these methods can become computationally prohibitive without optimizations or sparsity assumptions.
  4. Data Requirements: Constraint-based methods generally require substantial amounts of data to reliably estimate conditional independencies, especially when conditioning on larger sets of variables. Performance degrades significantly with insufficient data.
  5. Interpretation: Remember that PC outputs a Markov equivalence class (CPDAG), and FCI outputs a PAG. These represent sets of possible causal structures consistent with the data and assumptions, not necessarily the single ground truth DAG. Interpreting the specific edge types in a PAG is essential for understanding the uncertainty.

Constraint-based methods provide a powerful framework for reasoning about causal structure from observational data. While PC offers efficiency under the strong assumption of causal sufficiency, FCI and its variants provide robustness in the more realistic setting where latent confounders may be present. Understanding their assumptions, limitations, and the nature of their output is fundamental for applying them correctly in advanced causal inference workflows.

  • Causation, Prediction, and Search, Peter Spirtes, Clark Glymour, Richard Scheines, 2000 (MIT Press) DOI: 10.7551/mitpress/1754.001.0001 - Definitive textbook introducing PC and FCI algorithms and constraint-based causal discovery.
  • Elements of Causal Inference: Foundations and Learning Algorithms, Jonas Peters, Dominik Janzing, and Bernhard Schölkopf, 2017 (MIT Press) - Provides an introduction to causal inference, including constraint-based methods, in a machine learning context.

© 2026 ApX Machine Learning