![]() | This article includes a list ofgeneral references, butit lacks sufficient correspondinginline citations. Please help toimprove this article byintroducing more precise citations.(February 2011) (Learn how and when to remove this message) |
Part of a series on |
Bayesian statistics |
---|
![]() |
Posterior =Likelihood ×Prior ÷Evidence |
Background |
Model building |
Posterior approximation |
Estimators |
Evidence approximation |
Model evaluation |
ABayesian network (also known as aBayes network,Bayes net,belief network, ordecision network) is aprobabilistic graphical model that represents a set of variables and theirconditional dependencies via adirected acyclic graph (DAG).[1] While it is one of several forms ofcausal notation, causal networks are special cases of Bayesian networks. Bayesian networks are ideal for taking an event that occurred and predicting the likelihood that any one of several possible known causes was the contributing factor. For example, a Bayesian network could represent the probabilistic relationships between diseases and symptoms. Given symptoms, the network can be used to compute the probabilities of the presence of various diseases.
Efficient algorithms can performinference andlearning in Bayesian networks. Bayesian networks that model sequences of variables (e.g.speech signals orprotein sequences) are calleddynamic Bayesian networks. Generalizations of Bayesian networks that can represent and solve decision problems under uncertainty are calledinfluence diagrams.
Formally, Bayesian networks aredirected acyclic graphs (DAGs) whose nodes represent variables in theBayesian sense: they may be observable quantities,latent variables, unknown parameters or hypotheses. Each edge represents a direct conditional dependency. Any pair of nodes that are not connected (i.e. no path connects one node to the other) represent variables that areconditionally independent of each other. Each node is associated with aprobability function that takes, as input, a particular set of values for the node'sparent variables, and gives (as output) the probability (or probability distribution, if applicable) of the variable represented by the node. For example, if parent nodes representBoolean variables, then the probability function could be represented by a table of entries, one entry for each of the possible parent combinations. Similar ideas may be applied to undirected, and possibly cyclic, graphs such asMarkov networks.
Suppose we want to model the dependencies between three variables: the sprinkler (or more appropriately, its state - whether it is on or not), the presence or absence of rain and whether the grass is wet or not. Observe that two events can cause the grass to become wet: an active sprinkler or rain. Rain has a direct effect on the use of the sprinkler (namely that when it rains, the sprinkler usually is not active). This situation can be modeled with a Bayesian network (shown to the right). Each variable has two possible values, T (for true) and F (for false).
Thejoint probability function is, by thechain rule of probability,
whereG = "Grass wet (true/false)",S = "Sprinkler turned on (true/false)", andR = "Raining (true/false)".
The model can answer questions about the presence of a cause given the presence of an effect (so-called inverse probability) like "What is the probability that it is raining, given the grass is wet?" by using theconditional probability formula and summing over allnuisance variables:
Using the expansion for the joint probability function and the conditional probabilities from theconditional probability tables (CPTs) stated in the diagram, one can evaluate each term in the sums in the numerator and denominator. For example,
Then the numerical results (subscripted by the associated variable values) are
To answer an interventional question, such as "What is the probability that it would rain, given that we wet the grass?" the answer is governed by the post-intervention joint distribution function
obtained by removing the factor from the pre-intervention distribution. The do operator forces the value of G to be true. The probability of rain is unaffected by the action:
To predict the impact of turning the sprinkler on:
with the term removed, showing that the action affects the grass but not the rain.
These predictions may not be feasible given unobserved variables, as in most policy evaluation problems. The effect of the action can still be predicted, however, whenever the back-door criterion is satisfied.[2][3] It states that, if a setZ of nodes can be observed thatd-separates[4] (or blocks) all back-door paths fromX toY then
A back-door path is one that ends with an arrow intoX. Sets that satisfy the back-door criterion are called "sufficient" or "admissible." For example, the setZ = R is admissible for predicting the effect ofS = T onG, becauseRd-separates the (only) back-door pathS ← R → G. However, ifS is not observed, no other setd-separates this path and the effect of turning the sprinkler on (S = T) on the grass (G) cannot be predicted from passive observations. In that caseP(G | do(S = T)) is not "identified". This reflects the fact that, lacking interventional data, the observed dependence betweenS andG is due to a causal connection or is spurious(apparent dependence arising from a common cause,R). (seeSimpson's paradox)
To determine whether a causal relation is identified from an arbitrary Bayesian network with unobserved variables, one can use the three rules of "do-calculus"[2][5] and test whether alldo terms can be removed from the expression of that relation, thus confirming that the desired quantity is estimable from frequency data.[6]
Using a Bayesian network can save considerable amounts of memory over exhaustive probability tables, 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 no variable's local distribution depends on more than three parent variables, the Bayesian network representation stores 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 distributions.
Bayesian networks perform three main inference tasks:
Because a Bayesian network is a complete model for its variables and their relationships, it can be used to answer probabilistic queries about them. For example, the network can be used to update knowledge of the state of a subset of variables when other variables (theevidence variables) are observed. This process of computing theposterior distribution of variables given evidence is called probabilistic inference. The posterior gives a universalsufficient statistic for detection applications, when choosing values for the variable subset that minimize some expected loss function, for instance the probability of decision error. A Bayesian network can thus be considered a mechanism for automatically applyingBayes' 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 and AND/OR search, which allow for aspace–time tradeoff and match the efficiency of variable elimination when enough space is used. All of these methods have complexity that is exponential in the network'streewidth. The most commonapproximate inference algorithms areimportance sampling, stochasticMCMC simulation, mini-bucket elimination,loopy belief propagation,generalized belief propagation andvariational methods.
In order to fully specify the Bayesian network and thus fully represent thejoint probability distribution, it is necessary to specify for each nodeX the probability distribution forX conditional uponX's parents. The distribution ofX conditional upon its parents may have any form. It is common to work with discrete orGaussian distributions since that simplifies calculations. Sometimes only constraints on distribution are known; one can then use theprinciple of maximum entropy to determine a single distribution, the one with the greatestentropy given the constraints. (Analogously, in the specific context of adynamic Bayesian network, the conditional distribution for the hidden state's temporal evolution is commonly specified to maximize theentropy rate of the implied stochastic process.)
Often these conditional distributions include parameters that are unknown and must be estimated from data, e.g., via themaximum likelihood approach. Direct maximization of the likelihood (or of theposterior probability) is often complex given unobserved variables. A classical approach to this problem is theexpectation-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 them 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, making classical parameter-setting approaches more tractable.
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.
Automatically learning the graph structure of a Bayesian network (BN) is a challenge pursued withinmachine learning. The basic idea goes back to a recovery algorithm developed by Rebane andPearl[7] and rests on the distinction between the three possible patterns allowed in a 3-node DAG:
Pattern | Model |
---|---|
Chain | |
Fork | |
Collider |
The first 2 represent the same dependencies ( and are independent given) and are, therefore, indistinguishable. The collider, however, can be uniquely identified, since and are marginally independent and all other pairs are dependent. Thus, while theskeletons (the graphs stripped of arrows) of these three triplets are identical, the directionality of the arrows is partially identifiable. The same distinction applies when and have common parents, except that one must first condition on those parents. Algorithms have been developed to systematically determine the skeleton of the underlying graph and, then, orient all arrows whose directionality is dictated by the conditional independences observed.[2][8][9][10]
An alternative method of structural learning uses optimization-based search. It requires ascoring function and a search strategy. A common scoring function isposterior probability of the structure given the training data, like theBIC or the BDeu. The time requirement of anexhaustive search returning a structure that maximizes the score issuperexponential in the number of variables. A local search strategy makes incremental changes aimed at improving the score of the structure. A global search algorithm likeMarkov chain Monte Carlo can avoid getting trapped inlocal minima. Friedman et al.[11][12] discuss usingmutual information between variables and finding a structure that maximizes this. They do this by restricting the parent candidate set tok nodes and exhaustively searching therein.
A particularly fast method for exact BN learning is to cast the problem as an optimization problem, and solve it usinginteger programming. Acyclicity constraints are added to the integer program (IP) during solving in the form ofcutting planes.[13] Such method can handle problems with up to 100 variables.
In order to deal with problems with thousands of variables, a different approach is necessary. One is to first sample one ordering, and then find the optimal BN structure with respect to that ordering. This implies working on the search space of the possible orderings, which is convenient as it is smaller than the space of network structures. Multiple orderings are then sampled and evaluated. This method has been proven to be the best available in literature when the number of variables is huge.[14]
Another method consists of focusing on the sub-class of decomposable models, for which theMLE have a closed form. It is then possible to discover a consistent structure for hundreds of variables.[15]
Learning Bayesian networks with bounded treewidth is necessary to allow exact, tractable inference, since the worst-case inference complexity is exponential in the treewidth k (under the exponential time hypothesis). Yet, as a global property of the graph, it considerably increases the difficulty of the learning process. In this context it is possible to useK-tree for effective learning.[16]
Given data and parameter, a simpleBayesian analysis starts with aprior probability (prior) andlikelihood to compute aposterior probability.
Often the prior on depends in turn on other parameters that are not mentioned in the likelihood. So, the prior must be replaced by a likelihood, and a prior on the newly introduced parameters is required, resulting in a posterior probability
This is the simplest example of ahierarchical Bayes model.
The process may be repeated; for example, the parameters may depend in turn on additional parameters, which require their own prior. Eventually the process must terminate, with priors that do not depend on unmentioned parameters.
![]() | This sectionneeds expansion. You can help byadding to it.(March 2009) |
Given the measured quantitieseach withnormally distributed errors of knownstandard deviation,
Suppose we are interested in estimating the. An approach would be to estimate the using amaximum likelihood approach; since the observations are independent, the likelihood factorizes and the maximum likelihood estimate is simply
However, if the quantities are related, so that for example the individualhave themselves been drawn from an underlying distribution, then this relationship destroys the independence and suggests a more complex model, e.g.,
withimproper priors,. When, this is anidentified model (i.e. there exists a unique solution for the model's parameters), and the posterior distributions of the individual will tend to move, orshrink away from the maximum likelihood estimates towards their common mean. Thisshrinkage is a typical behavior in hierarchical Bayes models.
Some care is needed when choosing priors in a hierarchical model, particularly on scale variables at higher levels of the hierarchy such as the variable in the example. The usual priors such as theJeffreys prior often do not work, because the posterior distribution will not be normalizable and estimates made by minimizing theexpected loss will beinadmissible.
Several equivalent definitions of a Bayesian network have been offered. For the following, letG = (V,E) be adirected acyclic graph (DAG) and letX = (Xv),v ∈V be a set ofrandom variables indexed byV.
X is a Bayesian network with respect toG if its jointprobability density function (with respect to aproduct measure) can be written as a product of the individual density functions, conditional on their parent variables:[17]
where pa(v) is the set of parents ofv (i.e. those vertices pointing directly tov via a single edge).
For any set of random variables, the probability of any member of ajoint distribution can be calculated from conditional probabilities using thechain rule (given atopological ordering ofX) as follows:[17]
Using the definition above, this can be written as:
The difference between the two expressions is theconditional independence of the variables from any of their non-descendants, given the values of their parent variables.
X is a Bayesian network with respect toG if it satisfies thelocal Markov property: each variable isconditionally independent of its non-descendants given its parent variables:[18]
where de(v) is the set of descendants andV \ de(v) is the set of non-descendants ofv.
This can be expressed in terms similar to the first definition, as
The set of parents is a subset of the set of non-descendants because the graph isacyclic.
In general, learning a Bayesian network from data is known to beNP-hard.[19] This is due in part to thecombinatorial explosion ofenumerating DAGs as the number of variables increases. Nevertheless, insights about an underlying Bayesian network can be learned from data in polynomial time by focusing on its marginal independence structure:[20] while the conditional independence statements of a distribution modeled by a Bayesian network are encoded by a DAG (according to the factorization and Markov properties above), its marginal independence statements—the conditional independence statements in which the conditioning set is empty—are encoded by asimple undirected graph with special properties such as equalintersection andindependence numbers.
Developing a Bayesian network often begins with creating a DAGG such thatX satisfies the local Markov property with respect toG. Sometimes this is acausal DAG. The conditional probability distributions of each variable given its parents inG are assessed. In many cases, in particular in the case where the variables are discrete, if the joint distribution ofX is the product of these conditional distributions, thenX is a Bayesian network with respect toG.[21]
TheMarkov blanket of a node is the set of nodes consisting of its parents, its children, and any other parents of its children. The Markov blanket renders the node independent of the rest of the network; the joint distribution of the variables in the Markov blanket of a node is sufficient knowledge for calculating the distribution of the node.X is a Bayesian network with respect toG if every node is conditionally independent of all other nodes in the network, given itsMarkov blanket.[18]
This definition can be made more general by defining the "d"-separation of two nodes, where d stands for directional.[2] We first define the "d"-separation of a trail and then we will define the "d"-separation of two nodes in terms of that.
LetP be a trail from nodeu tov. A trail is a loop-free, undirected (i.e. all edge directions are ignored) path between two nodes. ThenP is said to bed-separated by a set of nodesZ if any of the following conditions holds:
The nodesu andv ared-separated byZ if all trails between them ared-separated. Ifu andv are not d-separated, they are d-connected.
X is a Bayesian network with respect toG if, for any two nodesu,v:
whereZ is a set whichd-separatesu andv. (TheMarkov blanket is the minimal set of nodes whichd-separates nodev from all other nodes.)
Although Bayesian networks are often used to representcausal relationships, this need not be the case: a directed edge fromu tov does not require thatXv be causally dependent onXu. This is demonstrated by the fact that Bayesian networks on the graphs:
are equivalent: that is they impose exactly the same conditional independence requirements.
A causal network is a Bayesian network with the requirement that the relationships be causal. The additional semantics of causal networks specify that if a nodeX is actively caused to be in a given statex (an action written as do(X = x)), then the probability density function changes to that of the network obtained by cutting the links from the parents ofX toX, and settingX to the caused valuex.[2] Using these semantics, the impact of external interventions from data obtained prior to intervention can be predicted.
In 1990, while working at Stanford University on large bioinformatic applications, Cooper proved that exact inference in Bayesian networks isNP-hard.[22] This result prompted research on approximation algorithms with the aim of developing a tractable approximation to probabilistic inference. In 1993, Paul Dagum andMichael Luby proved two surprising results on the complexity of approximation of probabilistic inference in Bayesian networks.[23] First, they proved that no tractabledeterministic algorithm can approximate probabilistic inference to within anabsolute errorɛ < 1/2. Second, they proved that no tractablerandomized algorithm can approximate probabilistic inference to within an absolute errorɛ < 1/2 with confidence probability greater than 1/2.
At about the same time,Roth proved that exact inference in Bayesian networks is in fact#P-complete (and thus as hard as counting the number of satisfying assignments of aconjunctive normal form formula (CNF)) and that approximate inference within a factor 2n1−ɛ for everyɛ > 0, even for Bayesian networks with restricted architecture, is NP-hard.[24][25]
In practical terms, these complexity results suggested that while Bayesian networks were rich representations for AI and machine learning applications, their use in large real-world applications would need to be tempered by either topological structural constraints, such as naïve Bayes networks, or by restrictions on the conditional probabilities. The bounded variance algorithm[26] developed by Dagum and Luby was the first provable fast approximation algorithm to efficiently approximate probabilistic inference in Bayesian networks with guarantees on the error approximation. This powerful algorithm required the minor restriction on the conditional probabilities of the Bayesian network to be bounded away from zero and one by where was any polynomial of the number of nodes in the network,.
Notable software for Bayesian networks include:
The term Bayesian network was coined byJudea Pearl in 1985 to emphasize:[28]
In the late 1980s Pearl'sProbabilistic Reasoning in Intelligent Systems[30] andNeapolitan'sProbabilistic Reasoning in Expert Systems[31] summarized their properties and established them as a field of study.
{{cite book}}
: CS1 maint: location missing publisher (link){{cite book}}
: CS1 maint: bot: original URL status unknown (link):Also appears asHeckerman, David (March 1997). "Bayesian Networks for Data Mining".Data Mining and Knowledge Discovery.1 (1):79–119.doi:10.1023/A:1009730122752.S2CID 6294315.