bnlearn implements key algorithms covering all stages of Bayesian
network modelling: data preprocessing, structure learning combining data and
expert/prior knowledge, parameter learning, and inference (including causal
inference via do-calculus). bnlearn aims to be a one-stop shop for
Bayesian networks in R. It provides tools for discrete, Gaussian and
conditional linear Gaussian, and zero-inflated count Bayesian networks on
real-world data. It also supportsd incomplete data with missing values.
Furthermore, the modular nature of bnlearn makes it easy to use it for
simulation studies.
Implemented structure learning algorithms include:
Constraint-based algorithms, which use conditional independence
tests to learn conditional independence constraints from data. The
constraints, in turn, are used to learn the structure of the Bayesian
network under the assumption that conditional independence implies
graphical separation (so, two variables that are independent cannot be
connected by an arc).
Score-based algorithms, which are general-purpose optimisation
algorithms that rank network structures with respect to a goodness-of-fit
score.
Hybrid algorithms combine aspects of both constraint-based and
score-based algorithms. They use conditional independence tests
(to reduce the search space) and network scores (to find the
optimal network in the reduced space) at the same time.
For more details about structure learning algorithms, see
structure learning. Available conditional independence tests are
described in independence tests and available network scores are
described in network scores. Specialized algorithms for learning the
structure of Bayesian network classifiers are described in
network classifiers. All algorithms support the use of whitelists and
blacklists to include or exclude arcs from the networks (see
whitelists and blacklists). Many have parallel implementation
built on the parallel package. Bayesian network scores also support
graphical priors.
Parameter learning approaches include both frequentist and Bayesian
estimators. Approximate inference is implemented particle
filters approaches, such as likelihood weighting, and covers conditional
probability queries, prediction and imputation. Exact inference is
implemented for discrete and Gaussian networks.
Additional facilities include support for bootstrap and cross-validation;
advanced plotting capabilities implemented on top of Rgraphviz and
lattice; model averaging; random graphs and random samples generation;
import/export functions to integrate bnlearn with software such as
Hugin and GeNIe; an associated Bayesian network repository of golden-standard
networks at https://www.bnlearn.com/bnrepository/.
Use citation("bnlearn") to find out how to cite bnlearn in
publications and other materials; and visit https://www.bnlearn.com/ for
more examples and code from publications using bnlearn.