[Paper Review] Bayesian structure learning and sampling of Bayesian networks with the R package BiDAG
This paper introduces the BiDAG R package for Bayesian structure learning and sampling in Bayesian networks using efficient Markov chain Monte Carlo (MCMC) methods. It proposes a hybrid approach combining constraint-based search space reduction (via PC algorithm or prior knowledge) with iterative order MCMC and partition MCMC, enabling scalable inference on large networks with hundreds of nodes. The key contribution is enabling accurate, fast, and scalable posterior sampling and MAP structure learning, even with limited data, outperforming traditional methods in both speed and accuracy for DAG discovery.
The R package BiDAG implements Markov chain Monte Carlo (MCMC) methods for structure learning and sampling of Bayesian networks. The package includes tools to search for a maximum a posteriori (MAP) graph and to sample graphs from the posterior distribution given the data. A new hybrid approach to structure learning enables inference in large graphs. In the first step, we define a reduced search space by means of the PC algorithm or based on prior knowledge. In the second step, an iterative order MCMC scheme proceeds to optimize within the restricted search space and estimate the MAP graph. Sampling from the posterior distribution is implemented using either order or partition MCMC. The models and algorithms can handle both discrete and continuous data. The BiDAG package also provides an implementation of MCMC schemes for structure learning and sampling of dynamic Bayesian networks.
Motivation & Objective
- To address the computational intractability of Bayesian structure learning in large Bayesian networks due to super-exponential growth of DAGs.
- To overcome the limitations of existing tools that focus only on finding a single best graph, which may misrepresent model uncertainty with small or noisy datasets.
- To develop efficient MCMC algorithms that scale to networks with hundreds of nodes while maintaining accuracy and convergence speed.
- To provide a flexible, open-source R package for both discrete and continuous data, including support for dynamic Bayesian networks.
- To enable posterior sampling and model averaging to reduce false-positive edges and improve robustness in structure discovery.
Proposed method
- Employs a hybrid structure learning approach: first, a reduced search space is defined using the PC algorithm or prior knowledge; second, iterative order MCMC optimizes this restricted space to find the MAP DAG.
- Implements two MCMC schemes: order MCMC (based on node orderings) and partition MCMC (based on partitioning the node set), both capable of sampling from the posterior distribution.
- Uses score functions that factorize per node: BDe for discrete data and BGe for continuous data, enabling efficient computation via pre-computed score tables.
- Applies computational optimizations to reduce the complexity of scoring each MCMC proposal from O(n^{K+1}) to O(n² log n) by pre-computing score tables, making the method feasible for large networks.
- Introduces a convergence diagnostic tool and model averaging via edge posterior probabilities, retaining only edges with posterior probability > 0.5 to reduce false positives.
- Supports first-order dynamic Bayesian networks (DBNs) and includes visualization tools via Rgraphviz and graph packages.
Experimental results
Research questions
- RQ1Can a hybrid MCMC approach combining constraint-based search space reduction with iterative order MCMC achieve faster and more accurate DAG structure learning in large networks?
- RQ2How does posterior sampling via order and partition MCMC compare to single-structure methods like PC or GES in terms of accuracy and false-positive control?
- RQ3To what extent can edge posterior probabilities (e.g., > 0.5) improve model selection by reducing false positives compared to relying on the MAP graph alone?
- RQ4How does the performance of order MCMC and partition MCMC scale with network size and parent set size (K), especially when K is large?
- RQ5Can the BiDAG package effectively learn and sample structures from real-world biological data, such as cancer subtypes, with modest sample sizes?
Key findings
- The iterative order MCMC scheme achieves faster convergence and better accuracy in recovering the true DAG compared to established methods like PC and GES, especially under noisy or sparse data conditions.
- Posterior sampling using partition MCMC and edge thresholding (posterior probability > 0.5) significantly reduces false-positive edges while preserving most true positives, outperforming single-MAP graph selection.
- For networks with n = 100 nodes, score table pre-computation reduces MCMC complexity from O(n^{K+1}) to O(n² log n), enabling feasible computation even for K up to 14.
- The runtime for score table computation becomes prohibitive for K > 7, but real-world networks are typically sparse (average parent set size 1.4), making the method practical for most applications.
- In the KIRP and KIRC cancer subtyping application, the consensus graph (based on posterior edge probabilities) recovered known biological interactions and revealed new edges (e.g., CCBL2–R3HDM1), demonstrating biological relevance.
- The package enables posterior sampling and model averaging on networks with hundreds of nodes, making it the first R package to achieve scalable Bayesian structure learning for large-scale Bayesian networks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.