Learning Large-Scale Bayesian Networks with the sparsebn Package

Bryon Aragam, Jiaying Gu, Qing ZhouarXiv 2017 · DOI

Abstract

Learning graphical models from data is an important problem with wide applications, ranging from genomics to the social sciences. Nowadays datasets often have upwards of thousands—sometimes tens or hundreds of thousands—of variables and far fewer samples. To meet this challenge, we have developed a new R package called sparsebn for learning the structure of large, sparse graphical models with a focus on Bayesian networks. While there are many existing software packages for this task, this package focuses on the unique setting of learning large networks from high-dimensional data, possibly with interventions. As such, the methods provided place a premium on scalability and consistency in a high-dimensional setting. Furthermore, in the presence of interventions, the methods implemented here achieve the goal of learning a causal network from data. Additionally, the sparsebn package is fully compatible with existing software packages for network analysis.

Introduction

Bayesian Networks (BNs) are essential for representing conditional dependencies and causal relationships, but learning their structure from data is notoriously difficult. Unlike undirected graphs, BNs must be Directed Acyclic Graphs (DAGs). This acyclicity constraint makes the underlying statistical problem non-convex and NP-hard. The challenge is amplified in fields like genomics, where datasets often contain tens of thousands of variables (genes) but very few samples ($p \gg n$). Most existing software packages either fail to scale to these dimensions or cannot handle "interventions"—experimental manipulations like gene knockouts that are crucial for distinguishing between correlation and causation.

Methods: A Score-Based Framework

The sparsebn package shifts away from traditional graph-theoretic search algorithms toward a score-based approach using regularized maximum likelihood. Key technical components include:

  • Structural Equation Models (SEMs): The package models each variable as a function of its parents, using Gaussian models for continuous data and multi-logit models for discrete data.
  • Sparse Regularization: To handle high-dimensionality, it employs penalties like $\ell_1$ (Lasso) or MCP (Minimax Concave Penalty). For discrete data, a group Lasso penalty ensures that all parameters associated with a specific edge are included or excluded together.
  • Block-Cyclic Coordinate Descent: Instead of updating one edge at a time, the algorithm updates parameters in blocks. Combined with "warm starts," this significantly accelerates convergence.
  • Causal Inference via Interventions: The package natively handles experimental data by modifying the likelihood function to "cut off" edges pointing toward intervened variables, allowing the algorithm to resolve observational equivalence.

Key Insights: The Solution Path

A core feature of sparsebn is the generation of a "solution path" rather than a single static graph. This provides a sequence of estimated graphs ranging from highly sparse to dense, allowing researchers to explore different levels of complexity based on domain knowledge or stability metrics.

The sparsebn solution path: A sequence of estimated graphs with varying levels of sparsity (controlled by the penalty parameter λ) and edge counts.

By treating structure learning as a continuous optimization problem via SEMs rather than a discrete combinatorial search, the package achieves massive speedups without sacrificing the ability to find high-quality local optima. Furthermore, simulation results demonstrate that as the number of interventions increases, the algorithm consistently converges toward the true causal DAG, even when the number of samples is small relative to the number of variables.

Performance and Results

The authors evaluated the package using synthetic benchmarks (Pathfinder, Scale-free topologies) and real-world biological data (Sachs protein-signaling and Alzheimer’s gene expression datasets). Key results include:

  • Scalability: In head-to-head timing comparisons with 1,090 nodes, sparsebn was 17x faster than the PC algorithm and 52x faster than the MMHC algorithm.
  • High-Dimensional Efficiency: The package successfully estimated a solution path for a 5,000-variable gene expression dataset in just over four minutes.

Conclusion and Future Work

While sparsebn is a significant step forward for high-dimensional network analysis, the authors identify several areas for future development. Currently, the package does not support hybrid networks containing both continuous and discrete variables. Future versions may also incorporate stochastic gradient descent to better navigate the non-convex landscape for global optima and utilize divide-and-conquer strategies for ultra-large-scale networks exceeding $10^5$ nodes.

Summary updated

BibTeX
@misc{aragam2017learning,
  author = {Bryon Aragam and Jiaying Gu and Qing Zhou},
  title = {{Learning Large-Scale Bayesian Networks with the sparsebn Package}},
  year = {2017},
  eprint = {1703.04025},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1703.04025},
}
Figure