Learning Sparse Bayesian Networks from High-Dimensional Data

Fast methods for learning sparse Bayesian networks from high-dimensional data using sparse regularization, as described in Aragam, Gu, and Zhou (2017) . Designed to handle mixed experimental and observational data with thousands of variables with either continuous or discrete observations.

Project Status: Active The project has reached a stable, usable state and is being actively developed. Travis-CI Build Status CRAN RStudio mirror downloads

Introducing sparsebn: A new R package for learning sparse Bayesian networks and other graphical models from high-dimensional data via sparse regularization. Designed from the ground up to handle:

  • Experimental data with interventions
  • Mixed observational / experimental data
  • High-dimensional data with p >> n
  • Datasets with thousands of variables (tested up to p=8000)
  • Continuous and discrete data

The emphasis of this package is scalability and statistical consistency on high-dimensional datasets. Compared to existing algorithms, sparsebn scales much better and is under active development. For more details on this package, including worked examples and the methodological background, please see our new preprint [1].


The main methods for learning graphical models are:

  • estimate.dag for directed acyclic graphs (Bayesian networks).
  • estimate.precision for undirected graphs (Markov random fields).
  • estimate.covariance for covariance matrices.

Currently, estimation of precision and covariances matrices is limited to Gaussian data.

The workhorse behind sparsebn is the sparsebnUtils package, which provides various S3 classes and methods for representing and manipulating graphs. The basic algorithms are implemented in ccdrAlgorithm and discretecdAlgorithm.


You can install:

  • the latest CRAN version with

  • the latest development version from GitHub with

    devtools::install_github(c("itsrainingdata/sparsebn/", "itsrainingdata/sparsebnUtils/dev", "itsrainingdata/ccdrAlgorithm/dev", "gujyjean/discretecdAlgorithm"))


[1] Aragam, B., Gu, J., and Zhou, Q. (2017). Learning large-scale Bayesian networks with the sparsebn package. arXiv: 1703.04025.

[2] Aragam, B. and Zhou, Q. (2015). Concave penalized estimation of sparse Gaussian Bayesian networks. The Journal of Machine Learning Research. 16(Nov):2273−2328.

[3] Fu, F., Gu, J., and Zhou, Q. (2014). Adaptive penalized estimation of directed acyclic graphs from categorical data. arXiv: 1403.2310.

[4] Aragam, B., Amini, A. A., and Zhou, Q. (2015). Learning directed acyclic graphs with penalized neighbourhood regression. arXiv: 1511.08963.

[5] Fu, F. and Zhou, Q. (2013). Learning sparse causal Gaussian networks with experimental intervention: Regularization and coordinate descent. Journal of the American Statistical Association, 108: 288-300.


sparsebn 0.0.5


  • estimate.dag now supports white lists and black lists (#6)
  • Cytoscape compatibility now available via the method openCytoscape (#4)
  • plotDAG now includes labels for each subplot by default
  • See NEWS files for sparsebnUtils, discretecdAlgorithm, and ccdrAlgorithm for more updates

sparsebn 0.0.4


  • Updated CITATION

sparsebn 0.0.3

Bug fixes

  • Minor bug fixes

sparsebn 0.0.2


  • Added a NEWS.md file to track changes to the package
  • Added plotDAG to provide convenient default for plotting large graphs
  • estimate.dag now takes an optional logical argument adaptive: If TRUE, then an adaptive version of the CD algorithm will be run for discrete data. This argument is ignored for continuous data.
  • Vignette updated and re-written

Bug fixes

  • Cytometry data has been fixed to correct some errors in the network structure; now correctly reflects the network learned in Sachs et al. (2005)

sparsebn 0.0.1

  • Initial stable release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.2 by Bryon Aragam, a year ago


Report a bug at https://github.com/itsrainingdata/sparsebn/issues

Browse source code at https://github.com/cran/sparsebn

Authors: Bryon Aragam [aut, cre] , Jiaying Gu [aut] , Dacheng Zhang [aut] , Qing Zhou [aut]

Documentation:   PDF Manual  

Task views: gRaphical Models in R, Graphical Models

GPL (>= 2) license

Depends on sparsebnUtils, ccdrAlgorithm, discretecdAlgorithm

Suggests knitr, rmarkdown, mvtnorm, igraph, graph, testthat

See at CRAN