CS188 Fall 2018 Section 7: Bayes Nets and Decision Nets

Similar documents
Decision making, Markov decision processes

Announcements. Midterm Review Session. Extended TA session on Friday 9am to 12 noon.

Midterm 2 V1. Introduction to Artificial Intelligence. CS 188 Spring 2015

CS 188 Fall Introduction to Artificial Intelligence Midterm 2

Midterm II. Introduction to Artificial Intelligence. CS 188 Spring ˆ You have approximately 1 hour and 50 minutes.

Bayes Networks. CS540 Bryan R Gibson University of Wisconsin-Madison. Slides adapted from those used by Prof. Jerry Zhu, CS540-1

Machine Learning. CS Spring 2015 a Bayesian Learning (I) Uncertainty

ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

Midterm II. Introduction to Artificial Intelligence. CS 188 Spring ˆ You have approximately 1 hour and 50 minutes.

Bayes Nets: Sampling

CS 343: Artificial Intelligence

Bayes Nets III: Inference

CS 188: Artificial Intelligence. Bayes Nets

Midterm II. Introduction to Artificial Intelligence. CS 188 Fall ˆ You have approximately 3 hours.

Probability Review Lecturer: Ji Liu Thank Jerry Zhu for sharing his slides

CS 188: Artificial Intelligence Fall 2011

Random Variables. A random variable is some aspect of the world about which we (may) have uncertainty

Final. Introduction to Artificial Intelligence. CS 188 Spring You have approximately 2 hours and 50 minutes.

CS 343: Artificial Intelligence

Probability Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 27 Mar 2012

Decision Graphs - Influence Diagrams. Rudolf Kruse, Pascal Held Bayesian Networks 429

CS188 Outline. CS 188: Artificial Intelligence. Today. Inference in Ghostbusters. Probability. We re done with Part I: Search and Planning!

CS 730/730W/830: Intro AI

Basic Probability and Statistics

Announcements. CS 188: Artificial Intelligence Fall Causality? Example: Traffic. Topology Limits Distributions. Example: Reverse Traffic

Our Status in CSE 5522

Hidden Markov Models. Vibhav Gogate The University of Texas at Dallas

Announcements. Inference. Mid-term. Inference by Enumeration. Reminder: Alarm Network. Introduction to Artificial Intelligence. V22.

PSY 305. Module 3. Page Title. Introduction to Hypothesis Testing Z-tests. Five steps in hypothesis testing

CS188 Outline. We re done with Part I: Search and Planning! Part II: Probabilistic Reasoning. Part III: Machine Learning

An AI-ish view of Probability, Conditional Probability & Bayes Theorem

10/18/2017. An AI-ish view of Probability, Conditional Probability & Bayes Theorem. Making decisions under uncertainty.

CS 188: Artificial Intelligence Fall Recap: Inference Example

Reinforcement Learning Wrap-up

IOE 202: lecture 14 outline

CS 188: Artificial Intelligence. Our Status in CS188

Department of Economics, University of California, Davis Ecn 200C Micro Theory Professor Giacomo Bonanno ANSWERS TO PRACTICE PROBLEMS 18

PROBABILITY. Inference: constraint propagation

Introduction to Fall 2009 Artificial Intelligence Final Exam

Where are we in CS 440?

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

Probability, Statistics, and Bayes Theorem Session 3

Selection of Variable Selecting the right variable for a control chart means understanding the difference between discrete and continuous data.

Introduction to Fall 2008 Artificial Intelligence Final Exam

Statistics for Business and Economics

Bayes Net Representation. CS 188: Artificial Intelligence. Approximate Inference: Sampling. Variable Elimination. Sampling.

CSE 473: Artificial Intelligence

Our Status. We re done with Part I Search and Planning!

Introduction to Machine Learning

CS 188: Artificial Intelligence Fall 2009

Where are we in CS 440?

CS221 Practice Midterm #2 Solutions

Probabilistic Reasoning

Introduction to Machine Learning

22s:152 Applied Linear Regression. Chapter 8: 1-Way Analysis of Variance (ANOVA) 2-Way Analysis of Variance (ANOVA)

CS 188 Fall Introduction to Artificial Intelligence Midterm 2

1 Matched pair comparison(p430-)

CS 188: Artificial Intelligence Spring Announcements

Uncertainty. Chapter 13

22s:152 Applied Linear Regression. 1-way ANOVA visual:

Inference in Bayesian networks

1. A Not So Random Walk

INTRODUCTION TO BAYESIAN INFERENCE PART 2 CHRIS BISHOP

Chapter 1: Revie of Calculus and Probability

Quantifying uncertainty & Bayesian networks

Exact Inference I. Mark Peot. In this lecture we will look at issues associated with exact inference. = =

Business Statistics. Lecture 5: Confidence Intervals

Statistical Decision Theory and Bayesian Analysis Chapter1 Basic Concepts. Outline. Introduction. Introduction(cont.) Basic Elements (cont.

Preference for Commitment

Midterm II. Introduction to Artificial Intelligence. CS 188 Fall You have approximately 3 hours.

Chapter 1 (Basic Probability)

MATH 446/546 Homework 2: Due October 8th, 2014

Intermediate Math Circles November 15, 2017 Probability III

Computer Science CPSC 322. Lecture 18 Marginalization, Conditioning

OPPA European Social Fund Prague & EU: We invest in your future.

CS188: Artificial Intelligence, Fall 2010 Written 3: Bayes Nets, VPI, and HMMs

CSE 473: Artificial Intelligence Probability Review à Markov Models. Outline

Probabilistic representation and reasoning

Bayesian Networks BY: MOHAMAD ALSABBAGH

Machine Learning, Fall 2009: Midterm

Lecture 5: Introduction to Markov Chains

10: Crosstabs & Independent Proportions

Module 03 Lecture 14 Inferential Statistics ANOVA and TOI

Artificial Intelligence CS 6364

Artificial Intelligence Uncertainty

7.5: Conditional Probability and Independent Events

Conditional probability

1 Differentiated Products: Motivation

Binary Logistic Regression

Worksheet 2 Problems

Uncertainty. Michael Peters December 27, 2013

Bayesian Network. Outline. Bayesian Network. Syntax Semantics Exact inference by enumeration Exact inference by variable elimination

Teoria das organizações e contratos

Announcements. CS 188: Artificial Intelligence Fall VPI Example. VPI Properties. Reasoning over Time. Markov Models. Lecture 19: HMMs 11/4/2008

De Finetti s ultimate failure. Krzysztof Burdzy University of Washington

Tutorial 6. By:Aashmeet Kalra

Uncertainty and knowledge. Uncertainty and knowledge. Reasoning with uncertainty. Notes

Econ 172A, Fall 2012: Final Examination Solutions (I) 1. The entries in the table below describe the costs associated with an assignment

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Relationships between variables. Visualizing Bivariate Distributions: Scatter Plots

Transcription:

CS188 Fall 2018 Section 7: Bayes Nets and Decision Nets 1 Bayes Nets: Inference Assume we are given the following Bayes net, and would like to perform inference to obtain P (B, D E = e, H = h). A B C D E F G H 1. What is the number of rows in the largest factor generated by inference by enumeration, for this query P (B, D E = e, H = h)? Assume all the variables are binary. 2 2 2 3 2 6 2 8 None of the above. Since the inference by enumeration first joins all the factors in the Bayes net, that factor will contain six (unobserved) variables. The question assumes all variables are binary, so the answer is 2 6. 2. Mark all of the following variable elimination orderings that are optimal for calculating the answer for the query P (B, D E = e, H = h). Optimality is measured by the sum of the sizes of the factors that are generated. Assume all the variables are binary. C, A, F, G F, G, C, A A, C, F, G G, F, C, A None of the above. The sum of the sizes of factors that are generated for the variable elimination ordering G, F, C, A is 2 1 + 2 1 + 2 2 + 2 2 rows, which is smaller than for any of the other variable elimination orderings. The ordering F, G, C, A is close but the sum of the sizes of factors is slightly bigger, with 2 2 + 2 1 + 2 2 + 2 2 rows. 3. Suppose we decide to perform variable elimination to calculate the query P (B, D E = e, H = h), and choose to eliminate F first. (a) When F is eliminated, what intermediate factor is generated and how is it calculated? Make sure it is clear which variable(s) come before the conditioning bar and which variable(s) come after. f 1 ( G C, e ) = f P (f C)P (G f, e) This follows from the first step of variable elimination, which is to join all factors containing F, and then marginalize over F to obtain the intermediate factor f 1. 1

(b) Now consider the set of distributions that can be represented by the remaining factors after F is eliminated. Draw the minimal number of directed edges on the following Bayes Net structure, so that it can represent any distribution in this set. If no additional directed edges are needed, please fill in that option below. A B C D No additional directed edges needed E G H An additional edge from C to G is necessary, because the intermediate factor is of the form f 1 (G C). Without this edge from C to G, the Bayes net would not be able to express the dependence of G on C. (Note that adding an edge from G to C is not allowed, since that would introduce a cycle.) 2 Sampling and Dynamic Bayes Nets We would like to analyze people s ice cream eating habits on sunny and rainy days Suppose we consider the weather, along with a person s ice-cream eating, over the span of two days. We ll have four random variables: W 1 and W 2 stand for the weather on days 1 and 2, which can either be rainy R or sunny S, and the variables I 1 and I 2 represent whether or not the person ate ice cream on days 1 and 2, and take values T (for truly eating ice cream) or F. We can model this as the following Bayes Net with these probabilities. W 1 P (W 1 ) S 0.6 R 0.4 W 1 W 2 P (W 2 W 1 ) S S 0.7 S R 0.3 R S 0.5 R R 0.5 W I P (I W ) S T 0.9 S F 0.1 R T 0.2 R F 0.8 Suppose we produce the following samples of (W 1, I 1, W 2, I 2 ) from the ice-cream model: R, F, R, F R, F, R, F S, F, S, T S, T, S, T S, T, R, F R, F, R, T S, T, S, T S, T, S, T S, T, R, F R, F, S, T 1. What is P (W 2 = R), the probability that sampling assigns to the event W 2 = R? Number of samples in which W 2 = R: 5. Total number of samples: 10. Answer 5/10 = 0.5. 2. Cross off samples above which are rejected by rejection sampling if we re computing P (W 2 I 1 = T, I 2 = F). Rejection sampling seems to be wasting a lot of effort, so we decide to switch to likelihood weighting. Assume we generate the following six samples given the evidence I 1 = T and I 2 = F: { } (W 1, I 1, W 2, I 2 ) = (S, T, R, F), (R, T, R, F), (S, T, R, F), (S, T, S, F), (S, T, S, F), (R, T, S, F) 2

3. What is the weight of the first sample (S, T, R, F) above? The weight given to a sample in likelihood weighting is Pr(e Parents(e)). Evidence variables e In this case, the evidence is I 1 = T, I 2 = F. The weight of the first sample is therefore w = Pr(I 1 = T W 1 = S) Pr(I 2 = F W 2 = R) = 0.9 0.8 = 0.72 4. Use likelihood weighting to estimate P (W 2 I 1 = T, I 2 = F). The sample weights are given by (W 1, I 1, W 2, I 2 ) w S, T, R, F 0.72 R, T, R, F 0.16 S, T, R, F 0.72 (W 1, I 1, W 2, I 2 ) w S, T, S, F 0.09 S, T, S, F 0.09 R, T, S, F 0.02 To compute the probabilities, we thus normalize the weights and find 0.72 + 0.16 + 0.72 P (W 2 = R I 1 = T, I 2 = F) = 0.72 + 0.16 + 0.72 + 0.09 + 0.09 + 0.02 = 0.889 P (W 2 = S I 1 = T, I 2 = F) = 1 0.889 = 0.111. 3

3 Decision Networks and VPI A used car buyer can decide to carry out various tests with various costs (e.g., kick the tires, take the car to a qualified mechanic) and then, depending on the outcome of the tests, decide which car to buy. We will assume that the buyer is deciding whether to buy car c and that there is time to carry out at most one test which costs $50 and which can help to figure out the quality of the car. A car can be in good shape (of good quality Q = +q) or in bad shape (of bad quality Q= q), and the test might help to indicate what shape the car is in. There are only two outcomes for the test T: pass (T=pass) or fail (T=fail). Car c costs $1,500, and its market value is $2,000 if it is in good shape; if not, $700 in repairs will be needed to make it in good shape. The buyers estimate is that c has 70% chance of being in good shape. The Decision Network is shown below. Buy Car? Q U T 1. Calculate the expected net gain from buying car c, given no test. EU(buy) = P (Q = +q) U(+q, buy) + P (Q = q) U( q, buy) =.7 500 + 0.3 200 = 290 2. Tests can be described by the probability that the car will pass or fail the test given that the car is in good or bad shape. We have the following information: P (T = pass Q = +q) = 0.9 P (T = pass Q = q) = 0.2 Calculate the probability that the car will pass (or fail) its test, and then the probability that it is in good (or bad) shape given each possible test outcome. P (T = pass) = q P (T = pass, Q = q) = P (T = pass Q = +q)p (Q = +q) + P (T = pass Q = q)p (Q = q) = 0.69 P (T = fail) = 0.31 P (T = pass Q = +q)p (Q = +q) P (Q = +q T = pass) = P (T = pass) 0.9 0.7 = = 21 0.69 23 0.91 P (T = fail Q = +q)p (Q = +q) P (Q = +q T = fail) = P (T = fail) 0.1 0.7 = = 7 0.31 31 0.22 3. Calculate the optimal decisions given either a pass or a fail, and their expected utilities. EU(buy T = pass) = P (Q = +q T = pass)u(+q, buy) + P (Q = q T = pass)u( q, buy) 0.91 500 + 0.09 ( 200) 437 EU(buy T = fail) = P (Q = +q T = fail)u(+q, buy) + P (Q = q T = fail)u( q, buy) EU( buy T = pass) = 0 EU( buy T = fail) = 0 0.22 500 + 0.78 ( 200) = 46 4

Therefore: MEU(T = pass) = 437 (with buy) and MEU(T = fail) = 0 (using buy) 4. Calculate the value of (perfect) information of the test. Should the buyer pay for a test? V P I(T ) = ( t P (T = t)meu(t = t)) MEU(φ) = 0.69 437 + 0.31 0 290 11.53 You shouldn t pay for it, since the cost is $50. 5