Abstract
This paper presents a rigorous performance comparison of four prominent causal discovery software packages: Tetrad (Java), BNT (Matlab), pcalg (R), and bnlearn (R). The study focuses on the "vanilla" task of recovering Directed Acyclic Graph (DAG) structures from linear, Gaussian structural equation models (SEMs) without latent variables. By evaluating 270 synthetic datasets across varying node counts, sample sizes, and graph densities, the authors provide a baseline for algorithm accuracy and computational efficiency. Results highlight the significant speed advantages of the Java-based Tetrad suite and the superior scalability of the Fast Greedy Equivalence Search (FGES) algorithm.
Introduction
Causal discovery—the process of inferring causal relationships from observational data—is a cornerstone of modern data science. While numerous algorithms exist to reconstruct Directed Acyclic Graphs (DAGs), the field is fragmented across different programming ecosystems. Researchers often select tools based on language familiarity (e.g., R vs. Matlab) rather than empirical performance metrics. This study addresses this gap by providing a head-to-head comparison of major public packages on standardized hardware, ensuring that software implementation choices are informed by data rather than platform preference.
Methodology
The authors evaluated four major public software packages: Tetrad (Java), BNT (Bayes Net Toolbox, Matlab), pcalg (R/C++), and bnlearn (R/C++). The comparison focused on two primary algorithmic families:
- Constraint-based methods: Such as the PC (Peter-Clark) algorithm, which utilizes statistical independence tests to prune edges from a complete graph.
- Score-based methods: Such as GES (Greedy Equivalence Search), which traverses the space of possible graphs to maximize a scoring criterion like the Bayesian Information Criterion (BIC).
To ensure fairness, all algorithms were executed on their native platforms but hosted on the same hardware (a 3.3 GHz Intel i7). Custom parsers were developed to standardize output formats, allowing for objective evaluation against ground-truth models regardless of the source language.
Experimental Design
The benchmarking suite comprised 270 datasets, representing 27 distinct parameter combinations (10 runs each). The variables were controlled across several dimensions:
- Variables (Nodes): 50, 100, and 500.
- Sample Sizes: 100, 500, and 1000.
- Graph Density: Average degrees of 2, 4, and 6 (representing the complexity of the causal web).
- Data Type: Linear Structural Equation Models (SEMs) with Gaussian noise.
These datasets have been made publicly available to encourage the community to test new algorithms against this established baseline.
Key Findings
Computational Efficiency
Contrary to the common assumption that C++ implementations are inherently faster than Java, the Java-based Tetrad implementations demonstrated a significant speed advantage. For instance, in a 100-variable problem, Tetrad’s Conservative PC (CPC) algorithm finished in 0.27 seconds, while the R-based pcalg equivalent required 3.9 seconds. Tetrad’s ability to leverage multi-core processing for parallelization provided a massive edge in the computationally intensive initial stages of graph construction.
The Dominance of FGES
The Fast Greedy Equivalence Search (FGES) emerged as the most robust algorithm in the study. It successfully debunked the notion that score-based searches are too computationally expensive for large-scale problems. FGES handled 500-variable models with ease, whereas other algorithms often stalled. Notably, Tetrad’s FGES implementation was observed to be 10 to 20 times faster than the pcalg implementation of GES.
Accuracy and Orientation
While most algorithms achieved high precision (near 100%) in identifying adjacencies—the connections between nodes—determining the direction of causality (orientation) proved more difficult. Standard PC algorithms often yielded orientations described by the authors as "fairly unusable." However, the use of "Conservative" PC (CPC) variants significantly boosted arrowhead precision, making them essential for researchers requiring reliable directional information.
Conclusion and Future Work
The study establishes that for the "vanilla" case of linear, Gaussian data, Tetrad and the FGES algorithm offer the best balance of speed and accuracy. However, the authors acknowledge that real-world data is rarely this well-behaved. Future research will extend this benchmarking framework to include:
- Discrete Data: Comparing performance on multinomial and categorical datasets.
- Non-Linearity: Testing how packages handle complex, non-linear causal relationships.
- Latent Variables: Moving beyond the assumption of no hidden causes to see how specialized algorithms (like those found in Tetrad) handle unmeasured confounders.
By providing an interactive visualization tool alongside their findings, the authors allow researchers to explore the full 270-dataset results table to determine which tool best fits their specific experimental constraints.
Summary updated