The R package BDgraph provides statistical tools for Bayesian structure learning for undirected graphical models with continuous, count, binary, and mixed data. The package is implemented the recent improvements in the Bayesian graphical models’ literature, including Mohammadi and Wit (2015), Mohammadi et al. (2021), Mohammadi et al. (2017), and Dobra and Mohammadi (2018). Besides, the package contains several functions for simulation and visualization, as well as several multivariate datasets taken from the literature. To speed up the computations, the computationally intensive tasks of the package are implemented in C++ in parallel using OpenMP.


You can install the latest version from CRAN using:

install.packages( "BDgraph" )


library( BDgraph )

Simple Examples for BDgraph package

To see how to use the functionality of the package:

See also Mohammadi and Wit (2019).