Lecture 29
Lecture 29
Lecture 29
P(a|b) = P (a ^ b)
P (b)
P(toothache)=.108+.012+.016+.064
= .20 or 20%
Inference Using Full Joint Distributions
P(toothachecavity) = .20 + ??
.072 + .008
.28
Inference Using Full Joint Distributions
Problems with joint distribution ??
▪ Worst case time: O(dn)
▪ Where d = max arity
▪ And n = number of random variables
▪ Space complexity also O(dn)
▪ Size of joint distribution
19
Independence
P( A | B) = P( A)
P( B | A) = P( B)
P( A B) = P( A) P( B)
Independence…
(I)
(II)
Conditional Independence II
P( E | H ) P( H )
P( H | E ) = (Substitute #3 in #1)
P( E )
Use to Compute Diagnostic Probability from Causal
Probability
P(M|S) =
Bayes Rule
Given: A patient takes a lab test, and the result comes back
positive. The test returns a correct positive result in only 98% of
the cases in which the disease is present, and a correct negative
result in only 97% of the cases in which the disease is not present.
Furthermore, 0.008 of the entire population have this cancer.
Bayesian Networks
▪ In general, joint distribution over set of variables (X1, X1, ... , Xn)
requires exponential space for representation & inference.
▪ We also saw that independence and conditional independence
relationships among variables can greatly reduce the number of
probabilities that need to be specified in order to define the full
joint distribution.
▪ BNs(a graphical representation) is a data structure
▪ represents the dependencies among variables and
▪ give a concise specification of any full joint probability distribution
Chain rule in Bayesian Networks
Earthquake Burglary
Alarm
JohnCalls MarryCalls
Example Bayes Net: Burglar Alarm
▪ Notice that the network does not have nodes corresponding to
▪ Mary’s currently listening to loud music or
▪ The telephone ringing and confusing John.
▪ These factors are summarized in the uncertainty associated with
the links from Alarm to to JohnCalls and MaryCalls .
Conditional probability table, or CPT
JohnCalls MarryCalls
Earthquake Burglary
Alarm
JohnCalls MarryCalls
Example
Given Markov Blanket, X is Independent of
All Other Nodes
Pr(B=t) Pr(B=f)
Earthquake Burglary 0.05 0.95
Pr(A|E,B)
e,b 0.9 (0.1)
e,b 0.2 (0.8)
Radio Alarm
e,b 0.85 (0.15)
e,b 0.01 (0.99)
Nbr1Calls Nbr2Calls
Conditional Probability Tables
▪ For complete spec. of joint dist., quantify BN
Earthquake Burglary
Alarm
John Mary
JohnCalls MarryCalls
Inference by Enumeration
Dynamic Programming
Variable Elimination
P(J)
= AP(J|A) f3(A)
= f4(J)
Example: P(B | J=true, M=true) using VE
Example: Traffic Domain
▪ T: Traffic
▪ L: Late for class! T +r +t 0.8
+r -t 0.2
-r +t 0.1
-r -t 0.9
L
+t +l 0.3
+t -l 0.7
-t +l 0.1
-t -l 0.9