Belief Networks Russell and Norvig: Chapter 15 CS121 – Winter 2002.

Slides:



Advertisements
Similar presentations
Bayesian networks Chapter 14 Section 1 – 2. Outline Syntax Semantics Exact computation.
Advertisements

Probabilistic Reasoning Bayesian Belief Networks Constructing Bayesian Networks Representing Conditional Distributions Summary.
Artificial Intelligence Universitatea Politehnica Bucuresti Adina Magda Florea
Belief networks Conditional independence Syntax and semantics Exact inference Approximate inference CS 460, Belief Networks1 Mundhenk and Itti Based.
1 Bayesian Networks Slides from multiple sources: Weng-Keen Wong, School of Electrical Engineering and Computer Science, Oregon State University.
Reasoning under Uncertainty Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
1 Knowledge Engineering for Bayesian Networks. 2 Probability theory for representing uncertainty l Assigns a numerical degree of belief between 0 and.
Identifying Conditional Independencies in Bayes Nets Lecture 4.
For Monday Read chapter 18, sections 1-2 Homework: –Chapter 14, exercise 8 a-d.
For Monday Finish chapter 14 Homework: –Chapter 13, exercises 8, 15.
1 22c:145 Artificial Intelligence Bayesian Networks Reading: Ch 14. Russell & Norvig.
Bayesian Networks Chapter 14 Section 1, 2, 4. Bayesian networks A simple, graphical notation for conditional independence assertions and hence for compact.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) March, 16, 2009.
Review: Bayesian learning and inference
Bayesian Networks. Motivation The conditional independence assumption made by naïve Bayes classifiers may seem to rigid, especially for classification.
Probabilistic Reasoning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 14 (14.1, 14.2, 14.3, 14.4) Capturing uncertain knowledge Probabilistic.
Bayesian networks Chapter 14 Section 1 – 2.
Bayesian Belief Networks
Uncertainty & Bayesian Belief Networks. 2 Data-Mining with Bayesian Networks on the Internet Internet can be seen as a massive repository of Data Data.
Bayesian Networks Russell and Norvig: Chapter 14 CMCS424 Fall 2003 based on material from Jean-Claude Latombe, Daphne Koller and Nir Friedman.
Bayesian Reasoning. Tax Data – Naive Bayes Classify: (_, No, Married, 95K, ?)
1 Probabilistic Belief States and Bayesian Networks (Where we exploit the sparseness of direct interactions among components of a world) R&N: Chap. 14,
Bayesian Networks Russell and Norvig: Chapter 14 CMCS421 Fall 2006.
Bayesian networks More commonly called graphical models A way to depict conditional independence relationships between random variables A compact specification.
Advanced Artificial Intelligence
Bayesian Networks Material used 1 Random variables
Bayesian networks Chapter 14. Outline Syntax Semantics.
A Brief Introduction to Graphical Models
Bayesian networks Chapter 14 Section 1 – 2. Bayesian networks A simple, graphical notation for conditional independence assertions and hence for compact.
An Introduction to Artificial Intelligence Chapter 13 & : Uncertainty & Bayesian Networks Ramin Halavati
B AYESIAN N ETWORKS. S IGNIFICANCE OF C ONDITIONAL INDEPENDENCE Consider Grade(CS101), Intelligence, and SAT Ostensibly, the grade in a course doesn’t.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 13, 2012.
Artificial Intelligence CS 165A Thursday, November 29, 2007  Probabilistic Reasoning / Bayesian networks (Ch 14)
B AYESIAN N ETWORKS. S OME A PPLICATIONS OF BN Medical diagnosis Troubleshooting of hardware/software systems Fraud/uncollectible debt detection Data.
Probabilistic Belief States and Bayesian Networks (Where we exploit the sparseness of direct interactions among components of a world) R&N: Chap. 14, Sect.
Bayesian networks. Motivation We saw that the full joint probability can be used to answer any question about the domain, but can become intractable as.
For Wednesday Read Chapter 11, sections 1-2 Program 2 due.
Bayesian Statistics and Belief Networks. Overview Book: Ch 13,14 Refresher on Probability Bayesian classifiers Belief Networks / Bayesian Networks.
1 Monte Carlo Artificial Intelligence: Bayesian Networks.
Introduction to Bayesian Networks
An Introduction to Artificial Intelligence Chapter 13 & : Uncertainty & Bayesian Networks Ramin Halavati
P ROBABILISTIC I NFERENCE. A GENDA Conditional probability Independence Intro to Bayesian Networks.
CS B 553: A LGORITHMS FOR O PTIMIZATION AND L EARNING Monte Carlo Methods for Probabilistic Inference.
The famous “sprinkler” example (J. Pearl, Probabilistic Reasoning in Intelligent Systems, 1988)
Probabilistic Reasoning [Ch. 14] Bayes Networks – Part 1 ◦Syntax ◦Semantics ◦Parameterized distributions Inference – Part2 ◦Exact inference by enumeration.
Marginalization & Conditioning Marginalization (summing out): for any sets of variables Y and Z: Conditioning(variant of marginalization):
Bayesian networks and their application in circuit reliability estimation Erin Taylor.
CS B 553: A LGORITHMS FOR O PTIMIZATION AND L EARNING Bayesian Networks.
1 Probability FOL fails for a domain due to: –Laziness: too much to list the complete set of rules, too hard to use the enormous rules that result –Theoretical.
Belief Networks Kostas Kontogiannis E&CE 457. Belief Networks A belief network is a graph in which the following holds: –A set of random variables makes.
Bayesian Networks Russell and Norvig: Chapter 14 CS440 Fall 2005.
Belief Networks CS121 – Winter Other Names Bayesian networks Probabilistic networks Causal networks.
PROBABILISTIC REASONING Heng Ji 04/05, 04/08, 2016.
Chapter 12. Probability Reasoning Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
CS 2750: Machine Learning Bayesian Networks Prof. Adriana Kovashka University of Pittsburgh March 14, 2016.
Web-Mining Agents Data Mining Prof. Dr. Ralf Möller Universität zu Lübeck Institut für Informationssysteme Karsten Martiny (Übungen)
Bayesian Networks CS182/CogSci110/Ling109 Spring 2007 Leon Barrett a.k.a. belief nets, bayes nets.
CS 2750: Machine Learning Directed Graphical Models
Bayesian Networks Chapter 14 Section 1, 2, 4.
Russell and Norvig: Chapter 14 CMCS424 Fall 2005
Bayesian networks Chapter 14 Section 1 – 2.
Presented By S.Yamuna AP/CSE
CAP 5636 – Advanced Artificial Intelligence
Bayesian Statistics and Belief Networks
CS 188: Artificial Intelligence Fall 2007
CS 188: Artificial Intelligence
Belief Networks CS121 – Winter 2003 Belief Networks.
Bayesian networks Chapter 14 Section 1 – 2.
Probabilistic Reasoning
Presentation transcript:

Belief Networks Russell and Norvig: Chapter 15 CS121 – Winter 2002

Other Names Bayesian networks Probabilistic networks Causal networks

Probabilistic Agent environment agent ? sensors actuators I believe that the sun will still exist tomorrow with probability and that it will be a sunny with probability 0.6

Probabilistic Belief There are several possible worlds that are indistinguishable to an agent given some prior evidence. The agent believes that a logic sentence B is True with probability p and False with probability 1-p. B is called a belief In the frequency interpretation of probabilities, this means that the agent believes that the fraction of possible worlds that satisfy B is p The distribution (p,1-p) is the strength of B

Problem At a certain time t, the KB of an agent is some collection of beliefs At time t the agent’s sensors make an observation that changes the strength of one of its beliefs How should the agent update the strength of its other beliefs?

Toothache Example A certain dentist is only interested in two things about any patient, whether he has a toothache and whether he has a cavity Over years of practice, she has constructed the following joint distribution: Toothache  Toothache Cavity  Cavity

In particular, this distribution implies that the prior probability of Toothache is 0.05 P(T) = P((T  C)v(T  C)) = P(T  C) + P(T  C) Toothache Example Using the joint distribution, the dentist can compute the strength of any logic sentence built with the proposition Toothache and Cavity Toothache  Toothache Cavity  Cavity

Toothache  Toothache Cavity  Cavity She now makes an observation E that indicates that a specific patient x has high probability (0.8) of having a toothache, but is not directly related to whether he has a cavity New Evidence

She now makes an observation E that indicates that a specific patient x has high probability (0.8) of having a toothache, but is not directly related to whether he has a cavity She can use this additional information to create a joint distribution (specific for x) conditional to E, by keeping the same probability ratios between Cavity and  Cavity The probability of Cavity that was 0.01 is now (knowing E) Adjusting Joint Distribution Toothache|E  Toothache|E Cavity|E  Cavity|E

Corresponding Calculus P(C|T) = P(C  T)/P(T) = 0.04/0.05 Toothache  Toothache Cavity  Cavity

Corresponding Calculus P(C|T) = P(C  T)/P(T) = 0.04/0.05 P(C  T|E) = P(C|T,E) P(T|E) = P(C|T) P(T|E) Toothache|E  Toothache|E Cavity|E  Cavity|E C and E are independent given T

Corresponding Calculus P(C|T) = P(C  T)/P(T) = 0.04/0.05 P(C  T|E) = P(C|T,E) P(T|E) = P(C|T) P(T|E) = (0.04/0.05)0.8 = Toothache|E  Toothache|E Cavity|E  Cavity|E

Generalization n beliefs X 1,…,X n The joint distribution can be used to update probabilities when new evidence arrives But: The joint distribution contains 2 n probabilities Useful independence is not made explicit Cavity CatchToothache If the dentist knows that the patient has a cavity (C), the probability of a probe catching in the tooth (K) does not depend on the presence of a toothache (T). More formally: P(T|C,K) = P(T|C) and P(K|C,T) = P(K|C)

Purpose of Belief Networks Facilitate the description of a collection of beliefs by making explicit causality relations and conditional independence among beliefs Provide a more efficient way (than by sing joint distribution tables) to update belief strengths when new evidence is observed

Alarm Example Five beliefs A: Alarm B: Burglary E: Earthquake J: JohnCalls M: MaryCalls

A Simple Belief Network BurglaryEarthquake Alarm MaryCallsJohnCalls causes effects Directed acyclic graph (DAG) Intuitive meaning of arrow from x to y: “x has direct influence on y” Nodes are beliefs

Assigning Probabilities to Roots BurglaryEarthquake Alarm MaryCallsJohnCalls P(B) P(E) 0.002

Conditional Probability Tables BEP(A| … ) TTFFTTFF TFTFTFTF BurglaryEarthquake Alarm MaryCallsJohnCalls P(B) P(E) Size of the CPT for a node with k parents: 2 k

Conditional Probability Tables BEP(A| … ) TTFFTTFF TFTFTFTF BurglaryEarthquake Alarm MaryCallsJohnCalls P(B) P(E) AP(J|…) TFTF AP(M|…) TFTF

What the BN Means BEP(A| … ) TTFFTTFF TFTFTFTF BurglaryEarthquake Alarm MaryCallsJohnCalls P(B) P(E) AP(J|…) TFTF AP(M|…) TFTF P(x1,x2,…,xn) =  i=1,…,n P(xi|Parents(Xi))

Calculation of Joint Probability BEP(A| … ) TTFFTTFF TFTFTFTF BurglaryEarthquake Alarm MaryCallsJohnCalls P(B) P(E) AP(J|…) TFTF AP(M|…) TFTF P(J  M  A   B   E) = P(J|A)P(M|A)P(A|  B,  E)P(  B)P(  E) = 0.9 x 0.7 x x x =

What The BN Encodes Each of the beliefs JohnCalls and MaryCalls is independent of Burglary and Earthquake given Alarm or  Alarm The beliefs JohnCalls and MaryCalls are independent given Alarm or  Alarm BurglaryEarthquake Alarm MaryCallsJohnCalls For example, John does not observe any burglaries directly

What The BN Encodes Each of the beliefs JohnCalls and MaryCalls is independent of Burglary and Earthquake given Alarm or  Alarm The beliefs JohnCalls and MaryCalls are independent given Alarm or  Alarm BurglaryEarthquake Alarm MaryCallsJohnCalls For instance, the reasons why John and Mary may not call if there is an alarm are unrelated Note that these reasons could be other beliefs in the network. The probabilities summarize these non-explicit beliefs

Structure of BN The relation: P(x 1,x 2,…,x n ) =  i=1,…,n P(x i |Parents(X i )) means that each belief is independent of its predecessors in the BN given its parents Said otherwise, the parents of a belief X i are all the beliefs that “directly influence” X i Usually (but not always) the parents of X i are its causes and X i is the effect of these causes E.g., JohnCalls is influenced by Burglary, but not directly. JohnCalls is directly influenced by Alarm

Construction of BN Choose the relevant sentences (random variables) that describe the domain Select an ordering X 1,…,X n, so that all the beliefs that directly influence X i are before X i For j=1,…,n do: Add a node in the network labeled by X j Connect the node of its parents to X j Define the CPT of X j The ordering guarantees that the BN will have no cycles The CPT guarantees that exactly the correct number of probabilities will be defined: no missing, no extra Use canonical distribution, e.g., noisy-OR, to fill CPT’s

Locally Structured Domain Size of CPT: 2 k, where k is the number of parents In a locally structured domain, each belief is directly influenced by relatively few other beliefs and k is small BN are better suited for locally structured domains

Set E of evidence variables that are observed with new probability distribution, e.g., {JohnCalls,MaryCalls} Query variable X, e.g., Burglary, for which we would like to know the posterior probability distribution P(X|E) Distribution conditional to the observations made Inference In BN ???????? TFTFTFTF TTFFTTFF P(B| … )MJ Note compactness of notation! P(X|obs) =  e P(X|e) P(e|obs) where e is an assignment of values to the evidence variables

Inference Patterns BurglaryEarthquake Alarm MaryCallsJohnCalls Diagnostic BurglaryEarthquake Alarm MaryCallsJohnCalls Causal BurglaryEarthquake Alarm MaryCallsJohnCalls Intercausal BurglaryEarthquake Alarm MaryCallsJohnCalls Mixed Basic use of a BN: Given new observations, compute the new strengths of some (or all) beliefs Other use: Given the strength of a belief, which observation should we gather to make the greatest change in this belief’s strength

Singly Connected BN A BN is singly connected if there is at most one undirected path between any two nodes BurglaryEarthquake Alarm MaryCallsJohnCalls is singly connected is not singly connected is singly connected

Types Of Nodes On A Path Radio Battery SparkPlugs Starts Gas Moves linear converging diverging

Independence Relations In BN Radio Battery SparkPlugs Starts Gas Moves linear converging diverging Given a set E of evidence nodes, two beliefs connected by an undirected path are independent if one of the following three conditions holds: 1. A node on the path is linear and in E 2. A node on the path is diverging and in E 3. A node on the path is converging and neither this node, nor any descendant is in E

Independence Relations In BN Radio Battery SparkPlugs Starts Gas Moves linear converging diverging Given a set E of evidence nodes, two beliefs connected by an undirected path are independent if one of the following three conditions holds: 1. A node on the path is linear and in E 2. A node on the path is diverging and in E 3. A node on the path is converging and neither this node, nor any descendant is in E Gas and Radio are independent given evidence on SparkPlugs

Independence Relations In BN Radio Battery SparkPlugs Starts Gas Moves linear converging diverging Given a set E of evidence nodes, two beliefs connected by an undirected path are independent if one of the following three conditions holds: 1. A node on the path is linear and in E 2. A node on the path is diverging and in E 3. A node on the path is converging and neither this node, nor any descendant is in E Gas and Radio are independent given evidence on Battery

Independence Relations In BN Radio Battery SparkPlugs Starts Gas Moves linear converging diverging Given a set E of evidence nodes, two beliefs connected by an undirected path are independent if one of the following three conditions holds: 1. A node on the path is linear and in E 2. A node on the path is diverging and in E 3. A node on the path is converging and neither this node, nor any descendant is in E Gas and Radio are independent given no evidence, but they are dependent given evidence on Starts or Moves

Answering Query P(X|E) X UmUm U1U1 YpYp Y1Y1...

Computing P(X|E) Computing P(X|E + ) X UmUm U1U1 YpYp Y1Y1... Given by the CPT of node X Same problem on a subset of the BN X Recursion ends when reaching an evidence, a root, or a leaf node Recursive back-chaining algorithm

Example: Sonia’s Office O: Sonia is in her office L: Lights are on in Sonia’s office C: Sonia is logged on to her computer O CL 0.4 P(O) TFTF P(C|O)O TFTF P(L|O)O We observe L=True What is the probability of C given this observation? --> Compute P(C|L=T)

Example: Sonia’s Office O CL 0.4 P(O) TFTF P(C|O)O TFTF P(L|O)O P(C|L=T)

Example: Sonia’s Office O CL 0.4 P(O) TFTF P(C|O)O TFTF P(L|O)O P(C|L=T) = P(C|O=T) P(O=T|L=T) + P(C|O=F) P(O=F|L=T)

Example: Sonia’s Office O CL 0.4 P(O) TFTF P(C|O)O TFTF P(L|O)O P(C|L=T) = P(C|O=T) P(O=T|L=T) + P(C|O=F) P(O=F|L=T) P(O|L) = P(O  L) / P(L) = P(L|O)P(O) / P(L)

Example: Sonia’s Office O CL 0.4 P(O) TFTF P(C|O)O TFTF P(L|O)O P(C|L=T) = P(C|O=T) P(O=T|L=T) + P(C|O=F) P(O=F|L=T) P(O|L) = P(O  L) / P(L) = P(L|O)P(O) / P(L) P(O=T|L=T) = 0.24/P(L) P(O=F|L=T) = 0.06/P(L)

Example: Sonia’s Office O CL 0.4 P(O) TFTF P(C|O)O TFTF P(L|O)O P(C|L=T) = P(C|O=T) P(O=T|L=T) + P(C|O=F) P(O=F|L=T) P(O|L) = P(O  L) / P(L) = P(L|O)P(O) / P(L) P(O=T|L=T) = 0.24/P(L) = 0.8 P(O=F|L=T) = 0.06/P(L) = 0.2

Example: Sonia’s Office O CL 0.4 P(O) TFTF P(C|O)O TFTF P(L|O)O P(C|L=T) = P(C|O=T) P(O=T|L=T) + P(C|O=F) P(O=F|L=T) P(O|L) = P(O  L) / P(L) = P(L|O)P(O) / P(L) P(O=T|L=T) = 0.24/P(L) = 0.8 P(O=F|L=T) = 0.06/P(L) = 0.2 P(C|L=T) = 0.8x x0.2 P(C|L=T) = 0.7

Complexity The back-chaining algorithm considers each node at most once It takes linear time in the number of beliefs But it computes P(X|E) for only one X Repeating the computation for every belief takes quadratic time By forward-chaining from E and clever bookkeeping, P(X|E) can be computed for all X in linear time If successive observations are made over time, the forward-chaining update is invoked after every new observation

Multiply-Connected BN A C D B To update the probability of D given some evidence E, we need to know how both B and C depend on E E “Solution”: A B,C D But this solution takes exponential time in the worst-case In fact, inference with multiply-connected BN is NP-hard

Stochastic Simulation Rain Sprinkler Cloudy WetGrass 1. Repeat N times: 1.1. Guess Cloudy at random 1.2. For each guess of Cloudy, guess Sprinkler and Rain, then WetGrass 2. Compute the ratio of the # runs where WetGrass and Cloudy are True over the # runs where Cloudy is True P(WetGrass|Cloudy)? P(WetGrass|Cloudy) = P(WetGrass  Cloudy) / P(Cloudy)

Applications /researchApps.html Medical diagnosis, e.g., lymph-node deseases Fraud/uncollectible debt detection Troubleshooting of hardware/software systems

Summary Belief update Role of conditional independence Belief networks Causality ordering Inference in BN Back-chaining for singly-connected BN Stochastic Simulation