Bayesian Networks Background Readings: An Introduction to Bayesian Networks, Finn Jensen, UCL Press, 1997. Some slides have been edited from Nir Friedman’s.

Slides:



Advertisements
Similar presentations
CS188: Computational Models of Human Behavior
Advertisements

NP-Hard Nattee Niparnan.
Markov Networks Alan Ritter.
Variational Methods for Graphical Models Micheal I. Jordan Zoubin Ghahramani Tommi S. Jaakkola Lawrence K. Saul Presented by: Afsaneh Shirazi.
CS498-EA Reasoning in AI Lecture #15 Instructor: Eyal Amir Fall Semester 2011.
Bayesian Network and Influence Diagram A Guide to Construction And Analysis.
Graphical Models BRML Chapter 4 1. the zoo of graphical models Markov networks Belief networks Chain graphs (Belief and Markov ) Factor graphs =>they.
Bayesian Networks, Winter Yoav Haimovitch & Ariel Raviv 1.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Exact Inference in Bayes Nets
Chapter 8-3 Markov Random Fields 1. Topics 1. Introduction 1. Undirected Graphical Models 2. Terminology 2. Conditional Independence 3. Factorization.
Junction Trees: Motivation Standard algorithms (e.g., variable elimination) are inefficient if the undirected graph underlying the Bayes Net contains cycles.
From Variable Elimination to Junction Trees
PGM 2003/04 Tirgul 3-4 The Bayesian Network Representation.
Global Approximate Inference Eran Segal Weizmann Institute.
. Bayesian Networks Lecture 9 Edited from Nir Friedman’s slides by Dan Geiger from Nir Friedman’s slides.
Bayesian Networks Clique tree algorithm Presented by Sergey Vichik.
. Inference I Introduction, Hardness, and Variable Elimination Slides by Nir Friedman.
Exact Inference: Clique Trees
Bayesian Networks Alan Ritter.
PGM 2002/03 Tirgul5 Clique/Junction Tree Inference.
. DAGs, I-Maps, Factorization, d-Separation, Minimal I-Maps, Bayesian Networks Slides by Nir Friedman.
. PGM 2002/3 – Tirgul6 Approximate Inference: Sampling.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 13, 2012.
Undirected Models: Markov Networks David Page, Fall 2009 CS 731: Advanced Methods in Artificial Intelligence, with Biomedical Applications.
Automated Planning and Decision Making Prof. Ronen Brafman Automated Planning and Decision Making 2007 Bayesian networks Variable Elimination Based on.
Introduction to Bayesian Networks
1 COROLLARY 4: D is an I-map of P iff each variable X is conditionally independent in P of all its non-descendants, given its parents. Proof  : Each variable.
1 Bayesian Networks (Directed Acyclic Graphical Models) The situation of a bell that rings whenever the outcome of two coins are equal can not be well.
1 Use graphs and not pure logic Variables represented by nodes and dependencies by edges. Common in our language: “threads of thoughts”, “lines of reasoning”,
Exact Inference in Bayes Nets. Notation U: set of nodes in a graph X i : random variable associated with node i π i : parents of node i Joint probability:
Today Graphical Models Representing conditional dependence graphically
. Bayesian Networks Some slides have been edited from Nir Friedman’s lectures which is available at Changes made by Dan Geiger.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
The NP class. NP-completeness
More NP-Complete and NP-hard Problems
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk
CS 2750: Machine Learning Directed Graphical Models
Inference in Bayesian Networks
PGM 2003/04 Tirgul6 Clique/Junction Tree Inference
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
Richard Anderson Lecture 26 NP-Completeness
Approximate Inference
Learning Bayesian Network Models from Data
Bell & Coins Example Coin1 Bell Coin2
CS 4/527: Artificial Intelligence
Exact Inference Continued
The set  of all independence statements defined by (3
Markov Properties of Directed Acyclic Graphs
Bayesian Networks (Directed Acyclic Graphical Models)
ICS 353: Design and Analysis of Algorithms
Read R&N Ch Next lecture: Read R&N
Dependency Models – abstraction of Probability distributions
CSCI 5822 Probabilistic Models of Human and Machine Learning
Bayesian Networks Based on
Inference Inference: calculating some useful quantity from a joint probability distribution Examples: Posterior probability: Most likely explanation: B.
Propagation Algorithm in Bayesian Networks
Exact Inference ..
Exact Inference Continued
Readings: K&F: 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7 Markov networks, Factor graphs, and an unified view Start approximate inference If we are lucky… Graphical.
Inference III: Approximate Inference
Approximate Inference by Sampling
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Junction Trees 3 Undirected Graphical Models
CSE 589 Applied Algorithms Spring 1999
Read R&N Ch Next lecture: Read R&N
Markov Networks.
Variable Elimination Graphical Models – Carlos Guestrin
Presentation transcript:

Bayesian Networks Background Readings: An Introduction to Bayesian Networks, Finn Jensen, UCL Press, 1997. Some slides have been edited from Nir Friedman’s lectures which is available at www.cs.huji.ac.il/~nir. Changes made by Dan Geiger. .

The “Visit-to-Asia” Example Smoking Lung Cancer Tuberculosis Abnormality in Chest Bronchitis X-Ray Dyspnea What are the relevant variables and their dependencies ?

Verifying the (in)Dependencies L T A B X D We can now ask the expert: do the following assertion hold? I ( S; V ) I ( T; S | V ) I ( l; {T, V} | S ) … I ( X; {V,S,T,L,B,D} | A) Alternative verification: Is each variable becoming independent of the rest, given its Markov boundary ? Take-Home Question: Are other variable construction orders as good ?

Quantifying the Bayesian Network p(v) p(s) V S L T A B X D p(t|v) p(l|s) p(b|s) p(a|t,l) p(d|a,b) p(x|a) Bayesian network = Directed Acyclic Graph (DAG), annotated with conditional probability distributions.

Local distributions p(A|T,L) p(A=y|L=n, T=n) = 0.02 (Yes/No) T A (Yes/no) p(A|T,L) Conditional Probability Table: p(A=y|L=n, T=n) = 0.02 p(A=y|L=n, T=y) = 0.60 p(A=y|L=y, T=n) = 0.99 p(A=y|L=y, T=y) = 0.99 Asymmetric independence in the CPT

Queries There are several types of queries. Most queries involve evidence An evidence e is an assignment of values to a set E of variables in the domain Example, A Posteriori belief: P(D=yes | V = yes ) Or in general: P(H=h | E = e ) where H and E are subsets of variables. Equivalent to computing P(H=h , E = e ) and then dividing.

A posteriori belief This query is useful in many cases: V S L T A B X D This query is useful in many cases: Prediction: what is the probability of an outcome given the starting condition Diagnosis: what is the probability of disease/fault given symptoms

Example: Predictive+Diagnostic Probabilistic inference can combine evidence form all parts of the network, Diagnostic and Predictive, regardless of the directions of edges in the model. P(T = Yes | Visit_to_Asia = Yes, Dyspnea = Yes ) V S L T A B X D

Queries: MAP Find the maximum a posteriori assignment for some variable of interest (say H1,…,Hl ) That is, h1,…,hl maximize the conditional probability P(h1,…,hl | e) Equivalent to maximizing the joint P(h1,…,hl, e)

Queries: MAP We can use MAP for: Explanation D1 D2 S2 S1 D3 D4 S4 S3 We can use MAP for: Explanation What is the most likely joint event, given the evidence (e.g., a set of likely diseases given the symptoms) What is the most likely scenario, given the evidence (e.g., a series of likely malfunctions that trigger a fault). Dead battery Not charging Bad battery Bad magneto Bad alternator

How Expressive are Bayesian Networks 1. Check the diamond example via all boundary bases. The following property holds for d-separation but does not hold for conditional independence: ID(X,{},Y) and ID (X,,Y)  ID (X,{}, ) or ID (,{},Y)

Markov Networks that represents probability distributions (rather than just independence) 1. Define for each (maximal) clique Ci a non-negative function g(Ci) called the compatibility function. 2. Take the product i g(Ci) over all cliques. 3. Define P(X1,…,Xn) = K· i g(Ci) where K is a normalizing factor (inverse sum of the product).

The two males and females example

Theorem 6 [Hammersley and Clifford 1971]: If a probability function P is formed by a normalized product of non negative functions on the cliques of G, then G is an I-map of P. Proof: It suffices to show (Theorem 5) that the neighborhood basis of G holds in P. Namely, show that I(,BG(), U-  -BG() hold in P, or just that: P(, BG(), U-  -BG()) = f1(,BG()) f2 (U-) (*) Let J stand for the set of indices marking all cliques in G that include . = f1(,BG()) f2 (U-) The first product contains only variables adjacent to  because Cj is a clique. The second product does not contain . Hence (*) holds.

Note: The theorem and converse hold also for extreme probabilities but the presented proof does not apply due to the use of Intersection in Theorem 5. Theorem X: Every undirected graph G has a distribution P such that G is a perfect map of P. (In light of previous notes, it must have the form of a product over cliques).

Drawback: Interpreting the Links is not simple Another drawback is the difficulty with extreme probabilities. There is no local test for I-mapness. Both drawbacks disappear in the class of decomposable models, which are a special case of Bayesian networks

Decomposable Models Example: Markov Chains and Markov Trees Assume the following chain is an I-map of some P(x1,x2,x3,x4) and was constructed using the methods we just described. The “compatibility functions” on all links can be easily interpreted in the case of chains. Same also for trees. This idea actually works for all chordal graphs.

Chordal Graphs

Interpretation of the links Clique 1 Clique 2 Clique 3 A probability distribution that can be written as a product of low order marginals divided by a product of low order marginals is said to be decomposable.

Importance of Decomposability When assigning compatibility functions it suffices to use marginal probabilities on cliques and just make sure to be locally consistent. Marginals can be assessed from experts or estimated directly from data.

The Diamond Example – The smallest non chordal graph Adding one more link will turn the graph to become chordal. Turning a general undirected graph into a chordal graph in some optimal way is the key for all exact computations done on Markov and Bayesian networks.

Extra Slides with more details If times allows

Complexity of Inference Theorem: Computing P(X = x) in a Bayesian network is NP-hard. Main idea: conditional probability tables with zeros and ones are equivalent to logical gates. Hence reducibility to 3-SAT is the easiest to pursue.

Proof We reduce 3-SAT to Bayesian network computation Assume we are given a 3-SAT problem: Q1,…,Qn be propositions, 1 ,... ,k be clauses, such that i = li1 li2  li3 where each lij is a literal over Q1,…,Qn (e.g., Q1 = true )  = 1... k We will construct a Bayesian network s.t. P(X=t) > 0 iff  is satisfiable

... 1 Q1 Q3 Q2 Q4 Qn 2 3 k A1 k-1 A2 X Ak-2 P(Qi = true) = 0.5, P(I = true | Qi , Qj , Ql ) = 1 iff Qi , Qj , Ql satisfy the clause I A1, A2, …, are simple binary AND gates

... It is easy to check Conclusion: polynomial reduction of 3-SAT 1 Q1 Q3 Q2 Q4 Qn 2 3 k A1 k-1 A2 X Ak-2 It is easy to check Polynomial number of variables Each Conditional Probability Table can be described by a small table (8 parameters at most) P(X = true) > 0 if and only if there exists a satisfying assignment to Q1,…,Qn Conclusion: polynomial reduction of 3-SAT

Inference is even #P-hard P(X = t) is the fraction of satisfying assignments to  Hence 2nP(X = t) is the number of satisfying assignments to  Thus, if we know to compute P(X = t), we know to count the number of satisfying assignments to. Consequently, computing P(X = t) is #P-hard.

Hardness - Notes We need not use deterministic relations in our construction. The construction shows that hardness follows even with a small degree graphs. Hardness does not mean we cannot do inference It implies that we cannot find a general procedure that works efficiently for all networks For particular families of networks, we can have provably efficient procedures (e.g., trees, HMMs). Variable elimination algorithms.

Proof of Theorem X Given a graph G, it is sufficient to show that for an independence statement  = I(,Z,) that does NOT hold in G, there exists a probability distribution that satisfies all independence statements that hold in the graph and does not satisfy  = I(,Z,). Well, simply pick a path in G between  and  that does not contain a node from Z. Define a probability distribution that is a perfect map of the chain and multiply it by any marginal probabilities on all other nodes forming P . Now “multiply” all P (Armstrong relation) to obtain P. Interesting task (Replacing HMW #4): Given an undirected graph over binary variables construct a perfect map probability distribution. (Note: most Markov random fields are perfect maps !).

Interesting conclusion of Theorem X: All independence statements that follow for strictly-positive probability from the neighborhood basis are derivable via symmetry, decomposition, intersection, and weak union. These axioms are (sound and) complete for neighborhood bases. These axioms are (sound and) complete also for pairwise bases. In fact for saturated statements conditional independence and separation have the same characterization. See paper P2 .

Chordal Graphs

Example of the Theorem Each cycle has a chord. There is a way to direct edges legally, namely, AB , AC , BC , BD , CD, CE Legal removal order (eg): start with E, than D, than the rest. The maximal cliques form a join (clique) tree.