Bayesian network

Jump to: navigation, search

Editor-In-Chief: C. Michael Gibson, M.S., M.D. [1]


A Bayesian network (or a belief network) is a probabilistic graphical model that represents a set of variables and their probabilistic independencies. For example, a Bayesian network can be used to calculate the probability of a patient having a specific disease, given the absence or presence of certain symptoms, if the probabilistic independencies between symptoms and disease as encoded by the graph hold. The term "Bayesian networks" was coined by Pearl (1985) to emphasize three aspects:

  1. The often subjective nature of the input information
  2. The reliance on Bayes's conditioning as the basis for updating information
  3. The distinction between causal and evidential modes of reasoning, which underscores Thomas Bayes's paper of 1763.

Formally, Bayesian networks are directed acyclic graphs whose nodes represent variables, and whose arcs encode conditional independencies between the variables. Nodes can represent any kind of variable, be it a measured parameter, a latent variable or a hypothesis. They are not restricted to representing random variables, which represents another "Bayesian" aspect of a Bayesian network. Efficient algorithms exist that perform inference and learning in Bayesian networks. Bayesian networks that model sequences of variables (such as for example speech signals or protein sequences) are called dynamic Bayesian networks. Generalizations of Bayesian networks that can represent and solve decision problems under uncertainty are called Influence diagrams.

Definitions and concepts

If there is an arc from node A to another node B, A is called a parent of B, and B is a child of A. The set of parent nodes of a node Xi is denoted by parents(Xi). A directed acyclic graph is a Bayesian Network relative to a set of variables if the joint distribution of the node values can be written as the product of the local distributions of each node and its parents:

If node Xi has no parents, its local probability distribution is said to be unconditional, otherwise it is conditional. If the value of a node is observed, then the node is said to be an evidence node.

Reading independencies and d-separation

The graph encodes independencies between variables. Conditional independence is represented by the graphical property of d-separation: If two sets of nodes X and Y are d-separated in the graph by a third set Z, then the corresponding variable sets X and Y are independent given the variables in Z. The minimal set of nodes which d-separates node X from all other nodes is given by X's Markov blanket.

D-separation is defined as follows: A path p is said to be d-separated (or blocked) by a set of nodes Z if and only if

1. p contains a chain p -> m -> j OR a fork i <- m -> j such that the middle node m is in Z


2. p contains an inverted fork (or collider) i -> m <- j such that the middle node m is not in Z and no descendant of m is in Z.

A set Z is said to d-separate x from y in a directed acyclic graph G if all paths from x to y in G are d-separated by Z. The 'd' in d-separation stands for 'directional', since the behavior of a three node link on a path depends on the direction of the arrows in the link.

Causal Bayesian networks

A Bayesian network is a carrier of the conditional independencies of a set of variables, not of their causal connections. However, causal relations can be modelled by the closely related causal Bayesian network. The additional semantics of the causal Bayesian networks specify that if a node X is actively caused to be in a given state x (an operation written as do(x)), then the probability density function changes to the one of the network obtained by cutting the links from X's parents to X, and setting X to the caused value x (Pearl, 2000). Using this semantics, one can predict the impact of external interventions from data obtained prior to intervention.


A simple Bayesian network.

Suppose that there are two reasons which could cause grass to be wet: either the sprinkler is on or it's raining. Also, suppose that the rain has a direct effect on the use of the sprinkler (namely that when it rains, the sprinkler is usually not turned on.) Then the situation can be modelled with the adjacent Bayesian network. All three variables have two possible values T (for true) and F (for false).

The joint probability function is:

where the names of the variables have been abbreviated to G = Grass wet, S = Sprinkler, and R = Rain.

The model can answer questions like "What is the likelihood that it is raining, given the grass is wet?" by using the conditional probability formula and summing over all nuisance variables:

As in the example numerator is pointed out explicitly, the joint probability function is used to calculate each iteration of the summation function. In the numerator marginalizing over and in the denominator marginalizing over and .

If, on the other hand, we wish to answer an interventional question: "What is the likelihood that it would rain, given that we wet the grass?" the answer would be governed by the post-intervention joint distribution function obtained by removing the factor from the pre-intervention distribution. As expected, the likelihood of rain is unaffected by the action: .

Using a Bayesian network can save considerable amounts of memory, if the dependencies in the joint distribution are sparse. For example, a naive way of storing the conditional probabilities of 10 two-valued variables as a table requires storage space for values. If the local distributions of no variable depends on more than 3 parent variables, the Bayesian network representation only needs to store at most values.

One advantage of Bayesian networks is that it is intuitively easier for a human to understand (a sparse set of) direct dependencies and local distributions than complete joint distribution.


Because a Bayesian network is a complete model for the variables and their relationships, it can be used to answer probabilistic queries about them. For example, the network can be used to find out updated knowledge of the state of a subset of variables when other variables (the evidence variables) are observed. This process of computing the posterior distribution of variables given evidence is called probabilistic inference. The posterior gives a universal sufficient statistic for detection applications, when one wants to choose values for the variable subset which minimize some expected loss function, for instance the probability of decision error. A Bayesian network can thus be considered a mechanism for automatically applying Bayes' theorem to complex problems.

The most common exact inference methods are variable elimination, which eliminates (by integration or summation) the non-observed non-query variables one by one by distributing the sum over the product; clique tree propagation, which caches the computation so that many variables can be queried at one time and new evidence can be propagated quickly; and recursive conditioning, which allows for a space-time tradeoff and matches the efficiency of variable elimination when enough space is used. All of these methods have complexity that is exponential in the network's treewidth. The most common approximate inference algorithms are stochastic MCMC simulation, mini-bucket elimination which generalizes loopy belief propagation, and variational methods.

Parameter learning

In order to fully specify the Bayesian network and thus fully represent the joint probability distribution, it is necessary to specify for each node X the probability distribution for X conditional upon X's parents. The distribution of X conditional upon its parents may have any form. It is common to work with discrete or Gaussian Distributions since that simplifies calculations. Sometimes only constraints on a distribution are known; one can then use the principle of maximum entropy to determine a single distribution, the one with the greatest entropy given the constraints. (Analogously, in the specific context of a dynamic Bayesian network, one commonly specifies the conditional distribution for the hidden state's temporal evolution to maximize the entropy rate of the implied stochastic process.)

Often these conditional distributions include parameters which are unknown and must be estimated from data, sometimes using the maximum likelihood approach. Direct maximization of the likelihood (or of the posterior probability) is often complex when there are unobserved variables. A classical approach to this problem is the expectation-maximization algorithm which alternates computing expected values of the unobserved variables conditional on observed data, with maximizing the complete likelihood (or posterior) assuming that previously computed expected values are correct. Under mild regularity conditions this process converges on maximum likelihood (or maximum posterior) values for parameters. A more fully Bayesian approach to parameters is to treat parameters as additional unobserved variables and to compute a full posterior distribution over all nodes conditional upon observed data, then to integrate out the parameters. This approach can be expensive and lead to large dimension models, so in practise classical parameter-setting approaches are more common.

Structure learning

In the simplest case, a Bayesian network is specified by an expert and is then used to perform inference. In other applications the task of defining the network is too complex for humans. In this case the network structure and the parameters of the local distributions must be learned from data.

Learning the structure of a Bayesian network (i.e., the graph) is a very important part of machine learning. Assuming that the data are generated from a Bayesian network and that all the variables are visible in every iteration, optimization based search method can be used to find the structure of the network. It requires a scoring function and a search strategy. A common scoring function is posterior probability of the structure given the training data. The time requirement of an exhaustive search returning back a structure that maximizes the score is superexponential in the number of variables. A local search strategy makes incremental changes aimed at improving the score of the structure. A global search algorithm like Markov chain Monte Carlo can avoid getting trapped in local minima. Friedman et al.[citation needed] talk about using mutual information between variables and finding a structure that maximizes this. They do this by restricting the parent candidate set to k nodes and exhaustively searching therein.


Bayesian networks are used for modelling knowledge in bioinformatics (gene regulatory networks, protein structure), medicine, engineering, document classification, image processing, data fusion, decision support systems[citation needed] and law[1].


Informal variants of such networks were first used by legal scholar John Henry Wigmore, in the form of Wigmore charts, to analyse trial evidence in 1913.[2] Another variant, called path diagrams was developed by the geneticist Sewal Wright[3] and used in social and behavioral sciences (mostly with linear parametric models).

See also

More information

Free and open source software

Commercial software


  1. Kadane & Schum (1996)
  2. Kadane & Schum (1996) 66-76
  3. Wright, S. (1921) "Correlation and Causation," Journal of Argicultural Research, 20:557-585.


  • Ben-Gal I., Bayesian Networks, in Ruggeri F., Kenett R., Faltin F. (Eds.), Encyclopedia of Statistics in Quality and Reliability, John Wiley & Sons, 2007.
  • Castillo, Enrique, José Manuel Gutiérrez, and Ali S. Hadi. Expert Systems and Probabilistic Network Models. New York: Springer-Verlag, 1997. ISBN 0-387-94858-9
  • Fenton NE and Neil M, "Combining evidence in risk analysis using Bayesian Networks".
  • Jensen, Finn V. (2001). Bayesian Networks and Decision Graphs. Springer.
  • Kadane, J. B. & Schum, D. A. (1996). A Probabilistic Analysis of the Sacco and Vanzetti Evidence. New York: Wiley. ISBN 0-471-14182-8.
  • Neil M, Fenton N, Tailor M, "Using Bayesian Networks to model Expected and Unexpected Operational Losses", Risk Analysis: An International Journal, Vol 25(4), 963-972, 2005.
  • Pearl, Judea. Bayesian Networks: A Model of Self-Activated Memory for Evidential Reasoning. Proceedings of the 7th Conference of the Cognitive Science Society, University of California, Irvine, pp. 329-334, August 15-17, 1985.
  • Pearl, Judea. Fusion, propagation, and structuring in belief networks. Artificial Intelligence 29(3):241–288, 1986.
  • Pearl, Judea (1988). Probabilistic Reasoning in Intelligent Systems. Morgan Kaufmann. ISBN 0-934613-73-7.
  • Pearl, Judea (2000). Causality: Models, Reasoning, and Inference. Cambridge University Press. ISBN 0-521-77362-8.
  • Pearl, Judea and Stuart Russell. Bayesian Networks, in M. A. Arbib (Ed.), Handbook of Brain Theory and Neural Networks, pp. 157–160, Cambridge, MA: MIT Press, 2003, ISBN 0-262-01197-2.
  • J.W. Comley and D.L. Dowe, "Minimum Message Length, MDL and Generalised Bayesian Networks with Asymmetric Languages", chapter 11 (pp265294) in P. Grunwald, M.A. Pitt and I.J. Myung (eds)., Advances in Minimum Description Length: Theory and Applications, Cambridge, MA: MIT Press, April 2005, ISBN 0-262-07262-9. (This paper puts decision trees in internal nodes of Bayes networks using Minimum Message Length (MML). An earlier version is Comley and Dowe (2003), .pdf.)
  • Christian Borgelt and Rudolf Kruse. Graphical Models – Methods for Data Analysis and Mining, Chichester, UK: Wiley, 2002, ISBN 0-470-84337-3
  • Korb, Kevin B. (2004). Bayesian Artificial Intelligence. CRC Press. ISBN 1-58488-387-1. Unknown parameter |adress= ignored (help); Unknown parameter |coauthors= ignored (help)
  • Nevin Lianwen Zhang and David Poole, A simple approach to Bayesian network computations, Proceedings of the Tenth Biennial Canadian Artificial Intelligence Conference (AI-94), Banff, May 1994, 171-178. This paper presents variable elimination for belief networks.
  • David Heckerman, A Tutorial on Learning with Bayesian Networks. In Learning in Graphical Models, M. Jordan, ed. MIT Press, Cambridge, MA, 1999. Also appears as Technical Report MSR-TR-95-06, Microsoft Research, March, 1995. An earlier version appears as Bayesian Networks for Data Mining, Data Mining and Knowledge Discovery, 1:79-119, 1997. The paper is about both parameter and structure learning in Bayesian networks.