CS 188: Artificial Intelligence Fall 2008 ecture 15: ayes Nets II 10/16/2008 Announcements Midterm 10/21: see prep page on web Split rooms! ast names A-J go to 141 McCone, K- to 145 winelle One page note sheet, non-programmable calculators eview sessions Friday and Sunday (similar) opics may include previous class but not this one No section next week! an Klein UC erkeley Next reading needs login/password 1 2 ayes Net ayes Nets A ayes net is an efficient encoding of a probabilistic model of a domain Questions we can ask: Inference: given a fixed N, what is P( e)? epresentation: given a fixed N, what kinds of distributions can it encode? Modeling: what N is most appropriate for a given domain? 3 4 : raffic ayes Net Semantics Variables : raffic : It rains : ow pressure : oof drips : allgame A ayes net: A set of nodes, one per variable A directed, acyclic graph A conditional distribution of each variable conditioned on its parents (the parameters θ) Semantics: A N defines a joint probability distribution over its variables: A 1 A n 5 6 1
uilding the (Entire) Joint : Alarm Network We can take a ayes net and build any entry from the full joint distribution it encodes ypically, there s no reason to build A of it We build what we need on the fly o emphasize: every N over a domain implicitly defines a joint distribution over that domain, specified by local probabilities and graph structure 7 8 Size of a ayes Net How big is a joint distribution over N oolean variables? How big is an N-node net if nodes have k parents? oth give you the power to calculate Ns: Huge space savings! Also easier to elicit local CPs Also turns out to be faster to answer queries (next class) 9 ayes Nets So far: What is a ayes net? What joint distribution does it encode? Next: how to answer queries about that distribution Key idea: conditional independence ast class: assembled Ns using an intuitive notion of conditional independence as causality oday: formalize these ideas Main goal: answer queries about conditional independence and influence After that: how to answer numerical queries (inference) 10 Conditional Independence eminder: independence and are independent if : Independence For this graph, you can fiddle with θ (the CPs) all you want, but you won t be able to represent any distribution in which the flips are dependent! and are conditionally independent given 1 2 (Conditional) independence is a property of a distribution 11 All distributions 12 2
opology imits istributions Independence in a N Given some graph topology G, only certain joint distributions can be encoded he graph structure guarantees certain (conditional) independences (here might be more independence) Adding arcs increases the set of distributions, but has several costs 13 Important question about a N: Are two nodes independent given certain evidence? If yes, can calculate using algebra (really tedious) If no, can prove with a counter example : Question: are and independent? Answer: not necessarily, we ve seen examples otherwise: low pressure causes rain which causes traffic. can influence, can influence (via ) Addendum: they could be independent: how? 14 Causal Chains Common Cause his configuration is a causal chain : ow pressure : ain : raffic Another basic configuration: two effects of the same cause Are and independent? Are and independent given? Is independent of given? : Project due : Newsgroup busy es! : ab full es! Evidence along the chain blocks the influence 15 Observing the cause blocks influence between effects. 16 Common Effect he General Case ast configuration: two causes of one effect (v-structures) Are and independent? es: remember the ballgame and the rain causing traffic, no correlation? Still need to prove they must be (try it!) Are and independent given? No: remember that seeing traffic put the rain and the ballgame in competition? his is backwards from the other cases Observing the effect enables influence between effects. : aining : allgame : raffic 17 Any complex example can be analyzed using these three canonical cases General question: in a given N, are two variables independent (given evidence)? Solution: analyze the graph 18 3
eachability eachability (-Separation) ecipe: shade evidence nodes Attempt 1: if two nodes are connected by an undirected path not blocked by a shaded node, they are conditionally independent Almost works, but not quite Where does it break? Answer: the v-structure at doesn t count as a link in a path unless active Question: Are and conditionally independent given evidence variables {}? ook for active paths from to No active paths = independence! A path is active if each triple is either a: Causal chain A C where is unobserved (either direction) Common cause A C where is unobserved Common effect (aka v-structure) A C where or one of its descendents is observed Active riples Inactive riples 19 21 es es es es 22 23 Causality? Variables: : aining : raffic : oof drips S: I m sad Questions: es S When ayes nets reflect the true causal patterns: Often simpler (nodes have fewer parents) Often easier to think about Often easier to elicit from experts Ns need not actually be causal Sometimes no causal net exists over the domain E.g. consider the variables raffic and rips End up with arrows that reflect correlation, not causation What do the arrows really mean? opology may happen to encode causal structure opology only guaranteed to encode conditional independence 24 25 4
: raffic asic traffic net et s multiply out the joint : everse raffic everse causality? r 1/4 r 3/4 r t 3/4 t 1/4 r t 3/16 r t 1/16 r t 6/16 r t 6/16 t 9/16 t 7/16 t r 1/3 r 2/3 r t 3/16 r t 1/16 r t 6/16 r t 6/16 r t 1/2 t 1/2 26 t r 1/7 r 6/7 27 : Coins Alternate Ns Extra arcs don t prevent representing independence, just allow non-independence 1 2 1 2 h t h t 28 29 Summary ayes nets compactly encode joint distributions Guaranteed independencies of distributions can be deduced from N graph structure he ayes ball algorithm (aka d-separation) A ayes net may have other independencies that are not detectable until you inspect its specific distribution 30 5