1 / 10

Understanding Bayes Nets: Computing Conditional Probabilities

Dive into the world of Bayes Nets also known as Causal Nets and learn to compute conditional probabilities efficiently using formulas and inference techniques. Explore joint distribution and practical examples to enhance your understanding.

ttaggart
Download Presentation

Understanding Bayes Nets: Computing Conditional Probabilities

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. L14. Inference with Bayes Nets • Bayes nets • Computing conditional probability

  2. P(A|B)P(B) P(A, B) P(B|A) = P(B|A) = P(A) P(A) P(A|B)P(B) P(B|A) = P(A|B)P(B) + P(A| B)P(B) Formulas to remember • Conditional probability • Production rule • P(A , B)=P(A|B)P(B) • Bayes rule

  3. Bayes Nets • It is also called “Causal nets”, “belief networks”, and • “influence diagrams”. • Bayes nets provide a general technique for computing • probabilities of causally related random variables given • evidence for some of them. • For example, • ? Joint distribution: P(Cold, Sore-throat, Runny-nose) True/False Cold Causal link Runny-nose Sore-throat True/False True/False

  4. Some “query”examples? • How likely is it that Cold, Sore-throat and Runny-nose are • all true? •  computeP(Cold, Sore-throat, Runny-nose) • How likely is it that I have a sore throat given that I have a • cold? •  compute P(Sore-throat|Cold) • How likely is it that I have a cold given that I have a sore • throat? •  computeP(Cold| Sore-throat) • How likely is it that I have a cold given that I have a sore • throat and a runny nose? •  computeP(Cold| Sore-throat, Runny-nose)

  5. For nets with a unique root ? Joint distribution: P(Cold, Sore-throat, Runny-nose) The joint probability distribution of all the variables in the net equals the probability of the root times the probability of each non-root node given its parents. P(Cold, Sore-throat, Runny-nose) = P(Cold)P(Sore-throat|Cold)P(Runny-nose|Cold) ? Prove it Cold Runny-nose Sore-throat

  6. Proof For the “Cold” example, from the Bayes nets we can assume that Sore-throat and Runny-nose are irrelevant, thus we can apply conditional independence. P(Sore-throat | Cold, Runny-nose) = P(Sore-throat | Cold) P(Runny-nose | Cold, Sore-throat) = P(Runny-nose | Cold) compute P(Cold, Sore-throat, Runny-nose) = P(Runny-nose | Sore-throat, Cold) P(Sore-throat | Cold)P(Cold) = P(Runny-nose | Cold) P(Sore-throat | Cold)P(Cold)

  7. P(Sore-throat | Cold) P(Cold) P(Cold | Sore-throat) = P(Sore-throat | Cold) P(Cold) + P(Sore-throat | Cold) P(Cold) Further observations • If there is no path that connects 2 nodes by a sequence of • causal links, the nodes are conditionally independent with • respect to root. For example, Sore-throat, Runny-nose • Since Bayes nets assumption is equivalent to conditional • independence assumptions, posterior probabilities in a • Bayes net can be computed using standard formulas from • probability theory

  8. An example P(S) = 0.3 P(L|S) = 0.5, P(L|S) = 0.05 P(C|L) = 0.7, P(C| L) = 0.06 Joint probability distribution: P(S, L, C) = P(S) P(L|S)P(C|L) = 0.3*0.5 *0.7 = 0.105 Habitual smoking 0.3 0.5  0.05 Lung cancer 0.7, 0.06 ? P(L|C) Chronic cough

  9. Compute P(L|C) P(S) = 0.3 P(L|S) = 0.5, P(L|S) = 0.05 P(C|L) = 0.7, P(C| L) = 0.06 Joint probability distribution: P(S, L, C) = P(S) P(L|S)P(C|L) = 0.3*0.5 *0.7 = 0.105 Habitual smoking 0.3 0.5, 0.05 Lung cancer P(L|C) = (P(C|L)P(L)) / (P(C)) P(C) = P(C/L)P(L) + P(C/L)P(L) P(L) = P(L/S)P(S) + P(L/ S)P(S) = 0.5*0.3 + 0.05*(1-0.3) = 0.185 P(L) = (1-0.185) = 0.815 P(C) = 0.7*0.185 + 0.06*0.815 = 0.1784 P(L|C) = 0.7*0.185 / 0.1784 = 0.7258968 0.7, 0.06 Chronic cough • General way of computing any conditional probability: • Express the conditional probabilities for all the nodes • Use the Bayes net assumption to evaluate the joint probabilities. • P(A) + P(A) = 1

  10. Quiz ? Could you write down the formulas to compute P(C, S, R), P(C|S) C Cold Runny-nose Sore-throat R S Home work: Could you calculate P(S|L) in page 8.

More Related