1 / 57

Notes on Graphical Models

Notes on Graphical Models. Padhraic Smyth Department of Computer Science University of California, Irvine. P(Data | Parameters). Real World Data. Probabilistic Model. P(Data | Parameters). Real World Data. Probabilistic Model. P(Parameters | Data). Generative Model, Probability.

agnes
Download Presentation

Notes on Graphical Models

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Notes on Graphical Models Padhraic Smyth Department of Computer Science University of California, Irvine

  2. P(Data | Parameters) Real World Data Probabilistic Model

  3. P(Data | Parameters) Real World Data Probabilistic Model P(Parameters | Data)

  4. Generative Model, Probability P(Data | Parameters) Real World Data Probabilistic Model P(Parameters | Data) Inference, Statistics

  5. Part 1: Review of Probability

  6. Notation and Definitions • X is a random variable • Lower-case x is some possible value for X • “X = x” is a logical proposition: that X takes value x • There is uncertainty about the value of X • e.g., X is the Dow Jones index at 5pm tomorrow • p(X = x) is the probability that proposition X=x is true • often shortened to p(x) • If the set of possible x’s is finite, we have a probability distribution and S p(x) = 1 • If the set of possible x’s is infinite, p(x) is a density function, and p(x) integrates to 1 over the range of X

  7. Example • Let X be the Dow Jones Index (DJI) at 5pm Monday August 22nd (tomorrow) • X can take real values from 0 to some large number • p(x) is a density representing our uncertainty about X • This density could be constructed from historical data, e.g., • After 5pm p(x) = 1 for some value of x (no uncertainty), once we hear from Wall Street what x is

  8. Probability as Degree of Belief • Different agents can have different p(x)’s • Your p(x) and the p(x) of a Wall Street expert might be quite different • OR: if we were on vacation we might not have access to stock market information • we would still be uncertain about p(x) after 5pm • So we should really think of p(x) as p(x | BI) • Where BI is background information available to agent I • (will drop explicit conditioning on BI in notation) • Thus, p(x) represents the degree of belief that agent I has in proposition x, conditioned on available background information

  9. Comments on Degree of Belief • Different agents can have different probability models • There is no necessarily “correct” p(x) • Why? Because p(x) is a model built on whatever assumptions or background information we use • Naturally leads to the notion of updating • p(x | BI) -> p(x | BI, CI) • This is the subjective Bayesian interpretation of probability • Generalizes other interpretations (such as frequentist) • Can be used in cases where frequentist reasoning is not applicable • We will use “degree of belief” as our interpretation of p(x) in this tutorial • Note! • Degree of belief is just our semantic interpretation of p(x) • The mathematics of probability (e.g., Bayes rule) remain the same regardless of our semantic interpretation

  10. Multiple Variables • p(x, y, z) • Probability that X=x AND Y=y AND Z =z • Possible values: cross-product of X Y Z • e.g., X, Y, Z each take 10 possible values • x,y,z can take 103 possible values • p(x,y,z) is a 3-dimensional array/table • Defines 103 probabilities • Note the exponential increase as we add more variables • e.g., X, Y, Z are all real-valued • x,y,z live in a 3-dimensional vector space • p(x,y,z) is a positive function defined over this space, integrates to 1

  11. Conditional Probability • p(x | y, z) • Probability of x given that Y=y and Z = z • Could be • hypothetical, e.g., “if Y=y and if Z = z” • observational, e.g., we observed values y and z • can also have p(x, y | z), etc • “all probabilities are conditional probabilities” • Computing conditional probabilities is the basis of many prediction and learning problems, e.g., • p(DJI tomorrow | DJI index last week) • expected value of [DJI tomorrow | DJI index next week) • most likely value of parameter a given observed data

  12. Computing Conditional Probabilities • Variables A, B, C, D • All distributions of interest related to A,B,C,D can be computed from the full joint distribution p(a,b,c,d) • Examples, using the Law of Total Probability • p(a) = S{b,c,d} p(a, b, c, d) • p(c,d) = S{a,b} p(a, b, c, d) • p(a,c | d) = S{b} p(a, b, c | d) where p(a, b, c | d) = p(a,b,c,d)/p(d) • These are standard probability manipulations: however, we will see how to use these to make inferences about parameters and unobserved variables, given data

  13. Two Practical Problems (Assume for simplicity each variable takes K values) • Problem 1: Computational Complexity • Conditional probability computations scale as O(KN) • where N is the number of variables being summed over • Problem 2: Model Specification • To specify a joint distribution we need a table of O(KN) numbers • Where do these numbers come from?

  14. Two Key Ideas • Problem 1: Computational Complexity • Idea: Graphical models • Structured probability models lead to tractable inference • Problem 2: Model Specification • Idea: Probabilistic learning • General principles for learning from data

  15. Part 2: Graphical Models

  16. “…probability theory is more fundamentally concerned with the structure of reasoning and causation than with numbers.” Glenn Shafer and Judea Pearl Introduction to Readings in Uncertain Reasoning, Morgan Kaufmann, 1990

  17. Conditional Independence • A is conditionally independent of B given C iff p(a | b, c) = p(a | c) (also implies that B is conditionally independent of A given C) • In words, B provides no information about A, if value of C is known • Example: • a = “reading ability” • b = “height” • c = “age” • Note that conditional independence does not imply marginal independence

  18. Graphical Models • Represent dependency structure with a directed graph • Node <-> random variable • Edges encode dependencies • Absence of edge -> conditional independence • Directed and undirected versions • Why is this useful? • A language for communication • A language for computation • Origins: • Wright 1920’s • Independently developed by Spiegelhalter and Lauritzen in statistics and Pearl in computer science in the late 1980’s

  19. A B C Examples of 3-way Graphical Models Marginal Independence: p(A,B,C) = p(A) p(B) p(C)

  20. A C B Examples of 3-way Graphical Models Conditionally independent effects: p(A,B,C) = p(B|A)p(C|A)p(A) B and C are conditionally independent Given A e.g., A is a disease, and we model B and C as conditionally independent symptoms given A

  21. A B C Examples of 3-way Graphical Models Independent Causes: p(A,B,C) = p(C|A,B)p(A)p(B)

  22. A B C Examples of 3-way Graphical Models Markov dependence: p(A,B,C) = p(C|B) p(B|A)p(A)

  23. MINVOLSET KINKEDTUBE PULMEMBOLUS INTUBATION VENTMACH DISCONNECT PAP SHUNT VENTLUNG VENITUBE PRESS MINOVL FIO2 VENTALV PVSAT ANAPHYLAXIS ARTCO2 EXPCO2 SAO2 TPR INSUFFANESTH HYPOVOLEMIA LVFAILURE CATECHOL LVEDVOLUME STROEVOLUME ERRCAUTER HR ERRBLOWOUTPUT HISTORY CO CVP PCWP HREKG HRSAT HRBP BP Real-World Example • Monitoring Intensive-Care Patients • 37 variables • 509 parameters • …instead of 237 • (figure courtesy of Kevin Murphy/Nir Friedman)

  24. B A C Directed Graphical Models p(A,B,C) = p(C|A,B)p(A)p(B)

  25. B A C Directed Graphical Models p(A,B,C) = p(C|A,B)p(A)p(B) In general, p(X1, X2,....XN) =  p(Xi | parents(Xi ) )

  26. B A C Directed Graphical Models p(A,B,C) = p(C|A,B)p(A)p(B) In general, p(X1, X2,....XN) =  p(Xi | parents(Xi ) ) • Probability model has simple factored form • Directed edges => direct dependence • Absence of an edge => conditional independence • Also known as belief networks, Bayesian networks, causal networks

  27. Reminders from Probability…. • Law of Total Probability P(a) = Sb P(a, b) = Sb P(a | b) P(b) • Conditional version: P(a|c) = Sb P(a, b|c) = Sb P(a | b , c) P(b|c) • Factorization or Chain Rule • P(a, b, c, d) = P(a | b, c, d) P(b | c, d) P(c | d) P (d), or = P(b | a, c, d) P(c | a, d) P(d | a) P(a), or = …..

  28. MINVOLSET KINKEDTUBE PULMEMBOLUS INTUBATION VENTMACH DISCONNECT PAP SHUNT VENTLUNG VENITUBE PRESS MINOVL FIO2 VENTALV PVSAT ANAPHYLAXIS ARTCO2 EXPCO2 SAO2 TPR INSUFFANESTH HYPOVOLEMIA LVFAILURE CATECHOL LVEDVOLUME STROEVOLUME ERRCAUTER HR ERRBLOWOUTPUT HISTORY CO CVP PCWP HREKG HRSAT HRBP BP Graphical Models for Computation • Say we want to compute P(BP|Press) • Law of total probability: -> must sum over all other variables -> exponential in # variables • Factorization: -> joint distribution factors into smaller tables • Can now sum over smaller tables, can reduce complexity dramatically

  29. Example D B E C A F G

  30. Example D B E C A F G p(A, B, C, D, E, F, G) =  p( variable | parents ) = p(A|B)p(C|B)p(B|D)p(F|E)p(G|E)p(E|D) p(D)

  31. Example D B E c A g F Say we want to compute p(a | c, g)

  32. Example D B E c A g F Direct calculation: p(a|c,g) = Sbdef p(a,b,d,e,f | c,g) Complexity of the sum is O(K4)

  33. Example D B E c A g F Reordering (using factorization): Sb p(a|b) Sd p(b|d,c) Se p(d|e) Sf p(e,f |g)

  34. Example D B E c A g F Reordering: Sbp(a|b) Sd p(b|d,c) Se p(d|e) Sf p(e,f |g) p(e|g)

  35. Example D B E c A g F Reordering: Sbp(a|b) Sd p(b|d,c) Se p(d|e) p(e|g) p(d|g)

  36. Example D B E c A g F Reordering: Sbp(a|b) Sd p(b|d,c) p(d|g) p(b|c,g)

  37. Example D B E c A g F Reordering: Sbp(a|b) p(b|c,g) p(a|c,g) Complexity is O(K), compared to O(K4)

  38. Graphs with “loops” D B E C A F G Message passing algorithm does not work when there are multiple paths between 2 nodes

  39. Graphs with “loops” D B E C A F G General approach: “cluster” variables together to convert graph to a tree

  40. Reduce to a Tree D B, E C A F G

  41. Probability Calculations on Graphs • General algorithms exist - beyond trees • Complexity is typically O(m (number of parents ) ) (where m = arity of each node) • If single parents (e.g., tree), -> O(m) • The sparser the graph the lower the complexity • Technique can be “automated” • i.e., a fully general algorithm for arbitrary graphs • For continuous variables: • replace sum with integral • For identification of most likely values • Replace sum with max operator

  42. Part 3: Learning with Graphical Models • Further Reading: • M. Jordan, Graphical models,  • Statistical Science: Special Issue on Bayesian Statistics, vol. 19, no. 1, pp. 140-155, Feb. 2004 • Gelman, J. B. Carlin, H. S. Stern, and D. B. Rubin, • Bayesian Data Analysis (2nded), Chapman and Hall, 2004

  43. Generative Model, Probability P(Data | Parameters) Real World Data Probabilistic Model P(Parameters | Data) Inference, Statistics

  44. The Likelihood Function • Likelihood = p(data | parameters) = p( D | f ) = L (f) • Likelihood tells us how likely the observed data are conditioned on a particular setting of the parameters • Details • Constants that do not involve f can be dropped in defining L (f) • Often easier to work with log L (f)

  45. Comments on the Likelihood Function • Constructing a likelihood function L (f) is the first step in probabilistic modeling • The likelihood function implicitly assumes an underlying probabilistic model M with parameters f • L (f) connects the model to the observed data • Graphical models provide a useful language for constructing likelihoods

  46. Binomial Likelihood • Binomial model • N memoryless trials, 2 outcomes • probability q of success at each trial • Observed data • r successes in n trials • Defines a likelihood: L(f) = p(D | f) = p(successes) p(non-successes) = f r (1-f)n-r

  47. Binomial Likelihood Examples

  48. Multinomial Likelihood • Multinomial model • N memoryless trials, K outcomes • Probability vector F for outcomes at each trial • Observed data • nj successes in n trials • Defines a likelihood: • Maximum likelihood estimates:

  49. Graphical Model for Multinomial f Parameters f = [ p(w1), p(w2),….. p(wk) ] w2 w1 wn Observed data

  50. “Plate” Notation Model parameters f wi Data = D = {w1,…wn} i=1:n Plate (rectangle) indicates replicated nodes in a graphical model Variables within a plate are conditionally independent manner given parent

More Related