Download presentation
Presentation is loading. Please wait.
Published byAlfred McBride Modified over 9 years ago
1
Artificial Intelligence CS 165A Thursday, November 29, 2007 Probabilistic Reasoning / Bayesian networks (Ch 14)
2
2 Notes Note the reading assignments for next week
3
3 Belief nets General assumptions –A DAG is a reasonable representation of the influences among the variables Leaves of the DAG have no direct influence on other variables –Conditional independences cause the graph to be much less than fully connected (the system is locally structured, or sparse) –The CPTs are relatively easy to state Many can be estimated as a canonical distribution (a standard pattern – just specify the parameters) or as a deterministic node (direct function – logical or numerical combination – of parents)
4
4 What are belief nets for? Given the structure, we can now pose queries: –Typically: P(Query | Evidence) or P(Cause | Symptoms) –P(X 1 | X 4, X 5 ) –P(Earthquake | JohnCalls) –P(Burglary | JohnCalls, MaryCalls) Query variable Evidence variables This is very similar to: –T ELL (KB, JohnCalls, MaryCalls) –A SK (KB, Burglary) Or agent view: P(state of world | percepts) leads to choice of action
5
5 X Y P(X) P(Y|X) A SK P(X|Y) RainingWet grass X Y P(X) P(Y|X) Z P(Z|Y) A SK P(X|Z) Rained Wet grass Worm sighting
6
6 Thursday Quiz 1.What is the joint probability distribution of the random variables described by this belief net? –I.e., what is P(U, V, W, X, Y, Z)? 2.Variables W and X are a)Independent b)Independent given U c)Independent given Y (choose one) 3.If you know the CPTs, is it possible to compute P(Z | U)? U X V W ZY
7
7 Review U X V W ZY P(V) P(X|U,V) P(U) P(W|U) P(Z|X)P(Y|W,X) Given this Bayesian network: 1.What are the CPTs? 2.What is the joint probability distribution of all the variables? 3.How would we calculate P(X | W, Y, Z)? P(U,V,W,X,Y,Z) = product of the CPTs = P(U) P(V) P(W|U) P(X|U,V) P(Y|W,X) P(Z|X)
8
8 How to construct a belief net Choose the random variables that describe the domain –These will be the nodes of the graph Choose a left-to-right ordering of the variables that indicates a general order of influence –“Root causes” to the left, symptoms to the right X1X1 X2X2 X3X3 X4X4 X5X5 CausesSymptoms
9
9 How to construct a belief net (cont.) Draw arcs from left to right to indicate “direct influence” (causality) among variables –May have to reorder some nodes X1X1 X2X2 X3X3 X4X4 X5X5 Define the conditional probability table (CPT) for each node –P(node | parents) P(X 1 ) P(X 2 ) P(X 3 | X 1,X 2 ) P(X 4 | X 2,X 3 ) P(X 5 | X 4 )
10
10 How to construct a belief net (cont.) To calculate any probability from the full joint distribution, use (1) definition of conditional probability and (2) marginalization –P(red vars | green vars) = ? (ignoring the blue vars) Joint PD Marginalization
11
11 Example: Flu and measles Flu MeaslesFever Spots P(Flu)P(Measles)P(Spots | Measles) P(Fever | Flu, Measles) To create the belief net: Choose variables (evidence and query) Choose an ordering and create links (direct influences) Fill in probabilities (CPTs)
12
12 Example: Flu and measles Flu MeaslesFever Spots P(Flu) = 0.01 P(Measles) = 0.001 P(Flu) P(Measles) P(Spots | Measles) P(Fever | Flu, Measles) P(Spots | Measles) = [0, 0.9] P(Fever | Flu, Measles) = [0.01, 0.8, 0.9, 1.0] Compute P(Flu | Fever) and P(Flu | Fever, Spots). Are they equivalent? CPTs:
13
13 Conditional Independence Can we determine conditional independence of variables directly from the graph? A set of nodes X is independent of another set of nodes Y, given a set of (evidence) nodes E, if every path from X to Y is d-separated, or blocked, by E 3 ways to block paths from X to Y, given E The set of nodes E d-separates sets X and Y
14
14 Examples XZY X ind. of Y? X ind. of Y given Z? X Z Y XZY XZY XZY
15
15 Independence (again) Variables X and Y are independent if and only if –P(X, Y) = P(X) P(Y) –P(X | Y) = P(X) –P(Y | X) = P(Y) We can determine independence of variables in a belief net directly from the graph –Variables X and Y are independent if they share no common ancestry I.e., the set of { X, parents of X, grandparents of X, … } has a null intersection with the set of {Y, parents of Y, grandparents of Y, … } XY X, Y dependent
16
16 Conditional Independence X and Y are (conditionally) independent given E iff –P(X | Y, E) = P(X | E) –P(Y | X, E) = P(Y | E) {X 1,…,X n } and {Y 1,…,Y m } are conditionally independent given {E 1,…,E k } iff –P(X 1,…,X n | Y 1, …, Y m, E 1, …,E k ) = P(X 1,…,X n | E 1, …,E k ) –P(Y 1, …, Y m | X 1,…,X n, E 1, …,E k ) = P(Y 1, …, Y m | E 1, …,E k ) We can determine conditional independence of variables (and sets of variables) in a belief net directly from the graph
17
17 How to determine conditional independence A set of nodes X is independent of another set of nodes Y, given a set of (evidence) nodes E, if every path from X i to Y j is d-separated, or blocked –The set of nodes E d-separates sets X and Y The textbook (p. 499) mentions the Markov blanket, which is the same general concept –But the description is brief and unclear…! There are three ways to block a path from X i to Y j
18
18 XZY #1 XZY XZY #2 XZY #3 This variable is not in E! (Nor are its descendents) The variable Z is in E
19
19 Examples GWR RainWet Grass Worms P(W | R, G) = P(W | G) FCT TiredFluCough P(T | C, F) = P(T | F) MIW WorkMoneyInherit P(W | I, M) P(W | M) P(W | I) = P(W)
20
20 Examples XZY X ind. of Y? X ind. of Y given Z? XZY XZY XZY Yes X Z Y X ind. of Y? X ind. of Y given Z? NoYes NoYes No
21
21 Examples (cont.) X Z Y X – wet grass Y – rainbow Z – rain X – rain Y – sprinkler Z – wet grass W – worms P(X, Y) P(X) P(Y) P(X | Y, Z) = P(X | Z) P(X, Y) = P(X) P(Y) P(X | Y, Z) P(X | Z) P(X | Y, W) P(X | W) X Z Y W Are X and Y ind.? Are X and Y cond. ind. given…?
22
22 Examples X W Y X – rain Y – sprinkler Z – rainbow W – wet grass Z X W Y X – rain Y – sprinkler Z – rainbow W – wet grass Z P(X,Y) = P(X) P(Y) Yes P(X | Y, Z) = P(X | Z) Yes P(X,Y) P(X) P(Y) No P(X | Y, Z) P(X | Z) No Are X and Y independent? Are X and Y conditionally independent given Z?
23
23 Conditional Independence Where are conditional independences here? Radio and Ignition, given Battery? Yes Radio and Starts, given Ignition? Yes Gas and Radio, given Battery? Yes Gas and Radio, given Starts? No Gas and Radio, given nil? Yes Gas and Battery, given Moves? No (why?)
24
24 Why is this important? Helps the developer (or the user) verify the graph structure –Are these things really independent? –Do I need more/fewer arcs? Gives hints about computational efficiencies Shows that you understand BNs…
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.