P ROBABILISTIC I NFERENCE. A GENDA Conditional probability Independence Intro to Bayesian Networks.

Slides:



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

Probability: Review The state of the world is described using random variables Probabilities are defined over events –Sets of world states characterized.
P ROBABILISTIC I NFERENCE. A GENDA Conditional probability Independence Intro to Bayesian Networks.
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.
I NTRODUCTION TO U NCERTAINTY S OURCES OF U NCERTAINTY Imperfect representations of the world Imperfect observation of the world Laziness, efficiency.
Identifying Conditional Independencies in Bayes Nets Lecture 4.
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.
I NFERENCE IN B AYESIAN N ETWORKS. A GENDA Reading off independence assumptions Efficient inference in Bayesian Networks Top-down inference Variable elimination.
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
CPSC 422 Review Of Probability Theory.
Bayesian Networks. Motivation The conditional independence assumption made by naïve Bayes classifiers may seem to rigid, especially for classification.
Bayesian networks Chapter 14 Section 1 – 2.
Bayesian Belief Networks
KI2 - 2 Kunstmatige Intelligentie / RuG Probabilities Revisited AIMA, Chapter 13.
Bayesian Networks Russell and Norvig: Chapter 14 CMCS424 Fall 2003 based on material from Jean-Claude Latombe, Daphne Koller and Nir Friedman.
Belief Networks Russell and Norvig: Chapter 15 CS121 – Winter 2002.
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.
Probabilistic Reasoning
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
CSCI 121 Special Topics: Bayesian Network Lecture #1: Reasoning Under Uncertainty.
I NTRODUCTION TO U NCERTAINTY Intelligent user interfaces Communication codes Protein sequence alignment Object tracking.
Artificial Intelligence CS 165A Tuesday, November 27, 2007  Probabilistic Reasoning (Ch 14)
Bayesian networks Chapter 14. Outline Syntax Semantics.
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.
B AYESIAN N ETWORKS. S OME A PPLICATIONS OF BN Medical diagnosis Troubleshooting of hardware/software systems Fraud/uncollectible debt detection Data.
P ROBABILISTIC I NFERENCE. A GENDA Random variables Bayes rule Intro to Bayesian Networks.
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.
1 Monte Carlo Artificial Intelligence: Bayesian Networks.
An Introduction to Artificial Intelligence Chapter 13 & : Uncertainty & Bayesian Networks Ramin Halavati
Reasoning with Uncertainty; Probabilistic Reasoning Foundations of Artificial Intelligence.
CS B 553: A LGORITHMS FOR O PTIMIZATION AND L EARNING Monte Carlo Methods for Probabilistic Inference.
Marginalization & Conditioning Marginalization (summing out): for any sets of variables Y and Z: Conditioning(variant of marginalization):
Review: Bayesian inference  A general scenario:  Query variables: X  Evidence (observed) variables and their values: E = e  Unobserved variables: Y.
CS B 553: A LGORITHMS FOR O PTIMIZATION AND L EARNING Bayesian Networks.
CPSC 7373: Artificial Intelligence Lecture 5: Probabilistic Inference Jiang Bian, Fall 2012 University of Arkansas at Little Rock.
Uncertainty Let action A t = leave for airport t minutes before flight Will A t get me there on time? Problems: 1.partial observability (road state, other.
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.
CS B 553: A LGORITHMS FOR O PTIMIZATION AND L EARNING Bayesian Networks.
Conditional Probability, Bayes’ Theorem, and Belief Networks CISC 2315 Discrete Structures Spring2010 Professor William G. Tanner, Jr.
Conditional Independence As with absolute independence, the equivalent forms of X and Y being conditionally independent given Z can also be used: P(X|Y,
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.
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.
Bayesian Networks Chapter 14 Section 1, 2, 4.
Bayesian networks Chapter 14 Section 1 – 2.
Presented By S.Yamuna AP/CSE
Qian Liu CSE spring University of Pennsylvania
Conditional Probability, Bayes’ Theorem, and Belief Networks
Bayesian Networks Probability In AI.
Read R&N Ch Next lecture: Read R&N
CS 188: Artificial Intelligence
CS 188: Artificial Intelligence Fall 2007
CAP 5636 – Advanced Artificial Intelligence
Belief Networks CS121 – Winter 2003 Belief Networks.
Bayesian networks Chapter 14 Section 1 – 2.
Probabilistic Reasoning
Read R&N Ch Next lecture: Read R&N
Presentation transcript:

P ROBABILISTIC I NFERENCE

A GENDA Conditional probability Independence Intro to Bayesian Networks

R EMEMBER : P ROBABILITY N OTATION L EAVES V ALUES I MPLICIT P(A  B) = P(A)+P(B)- P(A  B) means P(A=a  B=b) = P(A=a) + P(B=b) -P(A=a  B=b) For all a  Val(A) and b  Val(B) A and B are random variables. A=a and B=b are events. Random variables indicate many possible combinations of events

C ONDITIONAL P ROBABILITY P(A,B) = P(A|B) P(B) = P(B|A) P(A) P(A|B) is the posterior probability of A given knowledge of B Axiomatic definition: P(A|B) = P(A,B)/P(B)

C ONDITIONAL P ROBABILITY P(A|B) is the posterior probability of A given knowledge of B “For each value of b: given that I know B=b, what do I believe about A?” If a new piece of information C arrives, the agent’s new belief (if it obeys the rules of probability) should be P(A|B,C)

C ONDITIONAL D ISTRIBUTIONS StateP(state) C, T, P0.108 C, T,  P C,  T, P C,  T,  P  C, T, P  C, T,  P  C,  T, P  C,  T,  P P(Cavity|Toothache) = P(Cavity  Toothache)/P(Toothache) = ( )/( ) = 0.6 Interpretation: After observing Toothache, the patient is no longer an “average” one, and the prior probability (0.2) of Cavity is no longer valid P(Cavity|Toothache) is calculated by keeping the ratios of the probabilities of the 4 cases of Toothache unchanged, and normalizing their sum to 1

U PDATING THE B ELIEF S TATE  The patient walks into the dentists door  Let D now observe evidence E: Toothache holds with probability 0.8 (e.g., “the patient says so”)  How should D update its belief state? StateP(state) C, T, P0.108 C, T,  P C,  T, P C,  T,  P  C, T, P  C, T,  P  C,  T, P  C,  T,  P 0.576

U PDATING THE B ELIEF S TATE P(Toothache|E) = 0.8 We want to compute P(C  T  P|E) = P(C  P|T,E) P(T|E) Since E is not directly related to the cavity or the probe catch, we consider that C and P are independent of E given T, hence: P(C  P|T,E) = P(C  P|T) P(C  T  P|E) = P(C  P  T) P(T|E)/P(T) StateP(state) C, T, P0.108 C, T,  P C,  T, P C,  T,  P  C, T, P  C, T,  P  C,  T, P  C,  T,  P 0.576

U PDATING THE B ELIEF S TATE P(Toothache|E) = 0.8 We want to compute P(C  T  P|E) = P(C  P|T,E) P(T|E) Since E is not directly related to the cavity or the probe catch, we consider that C and P are independent of E given T, hence: P(C  P|T,E) = P(C  P|T) P(C  T  P|E) = P(C  P  T) P(T|E)/P(T) StateP(state) C, T, P0.108 C, T,  P C,  T, P C,  T,  P  C, T, P  C, T,  P  C,  T, P  C,  T,  P These rows should be scaled to sum to 0.8 These rows should be scaled to sum to 0.2

U PDATING THE B ELIEF S TATE P(Toothache|E) = 0.8 We want to compute P(C  T  P|E) = P(C  P|T,E) P(T|E) Since E is not directly related to the cavity or the probe catch, we consider that C and P are independent of E given T, hence: P(C  P|T,E) = P(C  P|T) P(C  T  P|E) = P(C  P  T) P(T|E)/P(T) StateP(state) C, T, P C, T,  P C,  T, P C,  T,  P  C, T, P  C, T,  P  C,  T, P  C,  T,  P These rows should be scaled to sum to 0.8 These rows should be scaled to sum to 0.2

I SSUES If a state is described by n propositions, then a belief state contains 2 n states (possibly, some have probability 0)  Modeling difficulty: many numbers must be entered in the first place  Computational issue: memory size and time

I NDEPENDENCE OF EVENTS Two events A=a and B=b are independent if P(A=a  B=b) = P(A=a) P(B=b) hence P(A=a|B=b) = P(A=a) Knowing B=b doesn’t give you any information about whether A=a is true

I NDEPENDENCE OF RANDOM VARIABLES Two random variables A and B are independent if P(A,B) = P(A) P(B) hence P(A|B) = P(A) Knowing B doesn’t give you any information about A [This equality has to hold for all combinations of values that A and B can take on, i.e., all events A=a and B=b are independent]

S IGNIFICANCE OF INDEPENDENCE If A and B are independent, then P(A,B) = P(A) P(B) => The joint distribution over A and B can be defined as a product of the distribution of A and the distribution of B Rather than storing a big probability table over all combinations of A and B, store two much smaller probability tables! To compute P(A=a  B=b), just look up P(A=a) and P(B=b) in the individual tables and multiply them together

C ONDITIONAL I NDEPENDENCE Two random variables A and B are conditionally independent given C, if P(A, B|C) = P(A|C) P(B|C) hence P(A|B,C) = P(A|C) Once you know C, learning B doesn’t give you any information about A [again, this has to hold for all combinations of values that A,B,C can take on]

S IGNIFICANCE OF C ONDITIONAL INDEPENDENCE Consider Rainy, Thunder, and RoadsSlippery Ostensibly, thunder doesn’t have anything directly to do with slippery roads… But they happen together more often when it rains, so they are not independent… So it is reasonable to believe that Thunder and RoadsSlippery are conditionally independent given Rainy So if I want to estimate whether or not I will hear thunder, I don’t need to think about the state of the roads, just whether or not it’s raining!

Toothache and PCatch are independent given Cavity, but this relation is hidden in the numbers! [Quiz] Bayesian networks explicitly represent independence among propositions to reduce the number of probabilities defining a belief state StateP(state) C, T, P0.108 C, T,  P C,  T, P C,  T,  P  C, T, P  C, T,  P  C,  T, P  C,  T,  P 0.576

B AYESIAN N ETWORK Notice that Cavity is the “cause” of both Toothache and PCatch, and represent the causality links explicitly Give the prior probability distribution of Cavity Give the conditional probability tables of Toothache and PCatch Cavity Toothache P(Cavity) 0.2 P(Toothache|c) Cavity  Cavity PCatch P(PCatch|c) Cavity  Cavity probabilities, instead of 7 P(C  T  P) = P(T  P|C) P(C) = P(T|C) P(P|C) P(C)

C ONDITIONAL P ROBABILITY T ABLES Cavity Toothache P(Cavity) 0.2 P(Toothache|c) Cavity  Cavity PCatch P(PCatch|c) Cavity  Cavity P(t|c)P(  t|c) Cavity  Cavity Rows sum to 1 If X takes n values, just store n-1 entries P(C  T  P) = P(T  P|C) P(C) = P(T|C) P(P|C) P(C)

S IGNIFICANCE OF B AYESIAN N ETWORKS If we know that variables are conditionally independent, we should be able to decompose joint distribution to take advantage of it Bayesian networks are a way of efficiently factoring the joint distribution into conditional probabilities And also building complex joint distributions from smaller models of probabilistic relationships But… What knowledge does the BN encode about the distribution? How do we use a BN to compute probabilities of variables that we are interested in?

B AYES ’ R ULE AND OTHER P ROBABILITY M ANIPULATIONS P(A,B) = P(A|B) P(B) = P(B|A) P(A) P(A|B) = P(B|A) P(A) / P(B) Gives us a way to manipulate distributions e.g. P(B) =  a P(B|A=a) P(A=a) Can derive P(A|B), P(B) using only P(B|A) and P(A)

A M ORE C OMPLEX BN BurglaryEarthquake Alarm MaryCallsJohnCalls causes effects Directed acyclic graph Intuitive meaning of arc from x to y: “x has direct influence on y”

BEP(A| … ) TTFFTTFF TFTFTFTF BurglaryEarthquake Alarm MaryCallsJohnCalls P(B) P(E) AP(J|…) TFTF AP(M|…) TFTF Size of the CPT for a node with k parents: 2 k A M ORE C OMPLEX BN 10 probabilities, instead of 31

W HAT DOES THE BN ENCODE ? Each of the beliefs JohnCalls and MaryCalls is independent of Burglary and Earthquake given Alarm or  Alarm BurglaryEarthquake Alarm MaryCallsJohnCalls For example, John does not observe any burglaries directly P(B  J)  P(B) P(J) P(B  J|A)  P(B|A) P(J|A)

W HAT DOES THE BN ENCODE ? The beliefs JohnCalls and MaryCalls are independent given Alarm or  Alarm For instance, the reasons why John and Mary may not call if there is an alarm are unrelated BurglaryEarthquake Alarm MaryCallsJohnCalls P(B  J|A)  P(B|A) P(J|A) P(J  M|A)  P(J|A) P(M|A) P(B  J|A)  P(B|A) P(J|A) P(J  M|A)  P(J|A) P(M|A) A node is independent of its non-descendants given its parents

W HAT DOES THE BN ENCODE ? BurglaryEarthquake Alarm MaryCallsJohnCalls A node is independent of its non-descendants given its parents Burglary and Earthquake are independent Burglary and Earthquake are independent The beliefs JohnCalls and MaryCalls are independent given Alarm or  Alarm For instance, the reasons why John and Mary may not call if there is an alarm are unrelated

L OCALLY S TRUCTURED W ORLD A world is locally structured (or sparse) if each of its components interacts directly with relatively few other components In a sparse world, the CPTs are small and the BN contains much fewer probabilities than the full joint distribution If the # of entries in each CPT is bounded by a constant, i.e., O(1), then the # of probabilities in a BN is linear in n – the # of propositions – instead of 2 n for the joint distribution

E QUATIONS I NVOLVING R ANDOM V ARIABLES G IVE R ISE TO C AUSALITY R ELATIONSHIPS C = A  B C = max(A,B) Constrains joint probability P(A,B,C) Nicely encoded as causality relationship C AB Conditional probability given by equation rather than a CPT

N AÏVE B AYES M ODELS P(Cause,Effect 1,…,Effect n ) = P(Cause)  i P(Effect i | Cause) Cause Effect 1 Effect 2 Effect n

N AÏVE B AYES C LASSIFIER P(Class,Feature 1,…,Feature n ) = P(Class)  i P(Feature i | Class) Class Feature 1 Feature 2 Feature n P(C|F 1,….,F k ) = P(C,F 1,….,F k )/P(F 1,….,F k ) = 1/Z P(C)  i P(Fi|C) Given features, what class? Spam / Not Spam English / French/ Latin … Word occurrences

B UT DOES A BN REPRESENT A BELIEF STATE ? I N OTHER WORDS, CAN WE COMPUTE THE FULL JOINT DISTRIBUTION OF THE PROPOSITIONS FROM IT ?

C ALCULATION OF J OINT P ROBABILITY 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  M  A  B  E) = P(J  M|A,  B,  E)  P(A  B  E) = P(J|A,  B,  E)  P(M|A,  B,  E)  P(A  B  E) (J and M are independent given A) P(J|A,  B,  E) = P(J|A) (J and B and J and E are independent given A) P(M|A,  B,  E) = P(M|A) P(A  B  E) = P(A|  B,  E)  P(  B|  E)  P(  E) = P(A|  B,  E)  P(  B)  P(  E) (B and E are independent) P(J  M  A  B  E) = P(J|A)P(M|A)P(A|  B,  E)P(  B)P(  E) BurglaryEarthquake Alarm MaryCallsJohnCalls

C ALCULATION OF J OINT P ROBABILITY 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 =

C ALCULATION OF J OINT P ROBABILITY 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 = P(x 1  x 2  …  x n ) =  i=1,…,n P(x i |parents(X i ))  full joint distribution table

C ALCULATION OF J OINT P ROBABILITY BEP(A| … ) TTFFTTFF TFTFTFTF BurglaryEarthquake Alarm MaryCallsJohnCalls P(B) P(E) AP(J|…) TFTF AP(M|…) TFTF P(x 1  x 2  …  x n ) =  i=1,…,n P(x i |parents(X i ))  full joint distribution table 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 = Since a BN defines the full joint distribution of a set of propositions, it represents a belief state

Q UERYING THE BN The BN gives P(T|C) What about P(C|T)? P(Cavity|T=t) = P(Cavity  T=t)/P(T=t) = P(T=t|Cavity) P(Cavity) / P(T=t) [Bayes’ rule] Querying a BN is just applying Bayes’ rule on a larger scale… algorithms next time Cavity Toothache P(C) 0.1 CP(T|C) TFTF

M ORE C OMPLICATED S INGLY -C ONNECTED B ELIEF N ET Radio Battery SparkPlugs Starts Gas Moves

S OME A PPLICATIONS OF BN Medical diagnosis Troubleshooting of hardware/software systems Fraud/uncollectible debt detection Data mining Analysis of genetic sequences Data interpretation, computer vision, image understanding

Region = {Sky, Tree, Grass, Rock} R2 R4 R3 R1 Above

BN to evaluate insurance risks

P URPOSES OF B AYESIAN N ETWORKS Efficient and intuitive modeling of complex causal interactions Compact representation of joint distributions O(n) rather than O(2 n ) Algorithms for efficient inference with given evidence (more on this next time)