AndreasHafver/ BayesianNetwork

Bayesian Networks for probabilistic analysis

Contributed by: Andreas Hafver

This is a simple implementation of Bayesian Networks (BNs) in the Wolfram Language. BNs are probabilistic graphical models for compactly representing multivariate probability distributions with conditional relationships among the variables. This implementation works with categorical (finite discrete) variables.

Installation Instructions

To install this paclet in your Wolfram Language environment, evaluate this code:
PacletInstall["AndreasHafver/BayesianNetwork"]


To load the code after installation, evaluate this code:
Needs["AndreasHafver`BayesianNetwork`"]

Details

The Wolfram Language has extenive support for probabilistic computations, however there is no inbuilt support for graphical models.
This paclet provides a BayesianNetwork function. A BayesianNetwork can be used with the function Probability to make inferences, and can be visualised using Graph.
The uer may construct multivariate probability distribution by defining each variable as an CategoricalDistribution or EmpiricalDistribution (which may conditionally depend on each other).
An advantage of implementing BNs in Wolfram Language is the ability to mix numeric and symbolic probabilities. This means that one can do inference even when probabilities are unknown/unspecified and use the symbolic answer to gain insights about a system.

Paclet Guide

Examples

Publisher

Andreas Hafver

Version History

  • 1.2.0 – 15 August 2025
  • 1.1.0 – 06 August 2025
  • 1.0.0 – 05 August 2025

License Information

MIT License

Paclet Source