Lecture 4 Bayes Theorem

Similar documents
Lecture 4 Bayes Theorem

Lecture 3 Probability Basics

Econ 325: Introduction to Empirical Economics

Conditional Probability. CS231 Dianna Xu

Lecture 3: Probability

Conditional probability

Bayesian RL Seminar. Chris Mansley September 9, 2008

Introduction into Bayesian statistics

STAT:5100 (22S:193) Statistical Inference I

Bayes Formula. MATH 107: Finite Mathematics University of Louisville. March 26, 2014

STAT509: Probability

With Question/Answer Animations. Chapter 7

Lecture 2. Conditional Probability

Announcements. Topics: To Do:

1 INFO 2950, 2 4 Feb 10

Example: Suppose we toss a quarter and observe whether it falls heads or tails, recording the result as 1 for heads and 0 for tails.

Joint, Conditional, & Marginal Probabilities

Lecture 1: Review of Probability

1.6/1.7 - Conditional Probability and Bayes Theorem

Today we ll discuss ways to learn how to think about events that are influenced by chance.

Consider an experiment that may have different outcomes. We are interested to know what is the probability of a particular set of outcomes.

CHAPTER 3 PROBABILITY: EVENTS AND PROBABILITIES

Single Maths B: Introduction to Probability

4. Conditional Probability P( ) CSE 312 Autumn 2012 W.L. Ruzzo

STAT Chapter 3: Probability

2011 Pearson Education, Inc

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 14

Mean, Median and Mode. Lecture 3 - Axioms of Probability. Where do they come from? Graphically. We start with a set of 21 numbers, Sta102 / BME102

Chapter 3 Conditional Probability and Independence. Wen-Guey Tzeng Computer Science Department National Chiao Tung University

1 Probability Theory. 1.1 Introduction

Statistics for Engineers Lecture 2

Lecture 4: Independent Events and Bayes Theorem

EE126: Probability and Random Processes

Lecture 3 - Axioms of Probability

Math 42, Discrete Mathematics

Statistics for Business and Economics

Denker FALL Probability- Assignment 6

STA Module 4 Probability Concepts. Rev.F08 1

Introduction: MLE, MAP, Bayesian reasoning (28/8/13)

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 10

Joint, Conditional, & Marginal Probabilities

Chapter. Probability

4. Conditional Probability

CMPSCI 240: Reasoning about Uncertainty

Lecture 7. Bayes formula and independence

18.600: Lecture 7 Bayes formula and independence

Probability Pr(A) 0, for any event A. 2. Pr(S) = 1, for the sample space S. 3. If A and B are mutually exclusive, Pr(A or B) = Pr(A) + Pr(B).

2.4. Conditional Probability

Machine Learning

Chapter 1 (Basic Probability)

Let us think of the situation as having a 50 sided fair die; any one number is equally likely to appear.

Lecture 10: Bayes' Theorem, Expected Value and Variance Lecturer: Lale Özkahya

Dept. of Linguistics, Indiana University Fall 2015

Basic Statistics for SGPE Students Part II: Probability theory 1

Discrete Probability

Introduction to probability

Info 2950, Lecture 4

M378K In-Class Assignment #1

MA : Introductory Probability

Intermediate Math Circles November 15, 2017 Probability III

CS626 Data Analysis and Simulation

Applied Bayesian Statistics

STAT 516: Basic Probability and its Applications

The enumeration of all possible outcomes of an experiment is called the sample space, denoted S. E.g.: S={head, tail}

What is Probability? Probability. Sample Spaces and Events. Simple Event

Conditional probability and independence

Lecture 23 Maximum Likelihood Estimation and Bayesian Inference

18.600: Lecture 7 Bayes formula and independence

LING 473: Day 5. START THE RECORDING Bayes Theorem. University of Washington Linguistics 473: Computational Linguistics Fundamentals

Introduction to Probability 2017/18 Supplementary Problems

(a) Fill in the missing probabilities in the table. (b) Calculate P(F G). (c) Calculate P(E c ). (d) Is this a uniform sample space?

Venn Diagrams; Probability Laws. Notes. Set Operations and Relations. Venn Diagram 2.1. Venn Diagrams; Probability Laws. Notes

Math 243 Section 3.1 Introduction to Probability Lab

Probability: Part 1 Naima Hammoud

Lecture 04: Conditional Probability. Lisa Yan July 2, 2018

CSC Discrete Math I, Spring Discrete Probability

Probability COMP 245 STATISTICS. Dr N A Heard. 1 Sample Spaces and Events Sample Spaces Events Combinations of Events...

UNIT 5 ~ Probability: What Are the Chances? 1

Elementary Discrete Probability

Basic Probabilistic Reasoning SEG

STAT 430/510 Probability

Lecture 3 : Probability II. Jonathan Marchini

Monty Hall Puzzle. Draw a tree diagram of possible choices (a possibility tree ) One for each strategy switch or no-switch

2.4 Conditional Probability

Probability deals with modeling of random phenomena (phenomena or experiments whose outcomes may vary)

Chapter 14. From Randomness to Probability. Copyright 2012, 2008, 2005 Pearson Education, Inc.

Discrete Structures Prelim 1 Selected problems from past exams

COMP61011 : Machine Learning. Probabilis*c Models + Bayes Theorem

Uncertainty. Russell & Norvig Chapter 13.

*Karle Laska s Sections: There is no class tomorrow and Friday! Have a good weekend! Scores will be posted in Compass early Friday morning

Review of Probabilities and Basic Statistics

CS 361: Probability & Statistics

Who was Bayes? Bayesian Phylogenetics. What is Bayes Theorem?

Bayesian Phylogenetics

Where are we? Knowledge Engineering Semester 2, Reasoning under Uncertainty. Probabilistic Reasoning

Chapter 2. Conditional Probability and Independence. 2.1 Conditional Probability

STAT J535: Introduction

Review of Basic Probability

Probability Theory. Probability and Statistics for Data Science CSE594 - Spring 2016

Event A: at least one tail observed A:

Transcription:

Lecture 4 Bayes Theorem Thais Paiva STA 111 - Summer 2013 Term II July 5, 2013

Lecture Plan 1 Probability Review 2 Bayes Theorem 3 More worked problems

Why Study Probability? A probability model describes the random phenomenon that determines how data is produced. Say we want to know if a coin is fair. Unknown parameter: probability of heads Population: infinite number of tosses Sample: 10 tosses and 4 are heads Estimate: sample estimate 4 10 = 0.40 We will later learn how to quantify the uncertainty in our estimate and if it is considerably different from 0.5.

Probability Review Important things from last class: Addition rule: P(A or B) = P(A) + P(B) P(A and B) Mutually exclusive events: P(A and B) = 0 Independent events: P(A and B) = P(A) P(B) Conditional probability: P(B A) = P(A and B) P(A)

Bayes Theorem Let s consider the events A and B. By the conditional probability formula we have P(A and B) = P(A B)P(B) P(A and B) = P(B A)P(A) By combining the two formulas we have P(A B)P(B) = P(B A)P(A) P(A B) = P(B A)P(A) P(B) This is a simplified version of Bayes theorem first proposed by Thomas Bayes in 1763.

Bayes Theorem P(A B) = P(B A)P(A) P(B) We establish the relation between P(A B) and P(B A) The textbook calls this tree reversal Bayes theorem is very important in Bayesian analysis, which we will see later in the course. Suppose we are interested in a parameter θ and we observed some data. P(θ data) = P(data θ)p(θ) P(data) where P(data θ) describes how the data is generated and P(θ) describes our prior information on θ.

Paternity Suits Legal cases of disputed paternity in many countries are resolved using blood tests. Laboratories make genetic determinations concerning the mother, child, and alleged father. Suppose you are on a jury considering a paternity suit The mother has blood type O The alleged father has blood type AB The child has blood type B

Paternity Suits Here is some information we need to solve the problem. According to genetics, There is a 50% chance that this child will have blood type B if this alleged father is the real father Based on percentage of B genes in the population, there is a 9% chance that this child would have blood type B if this alleged father was not the real father Based on other evidence (e.g., testimonials, physical evidence, records) presented before the DNA test, you believe there is a 75% chance that the alleged father is the real father. This assessment is your prior belief

Paternity Suits Given: P(son = B father = true) = 0.5 P(son = B father = false) = 0.09 P(father = true) = 0.75 Our goal is P(father = true son = B) = where P(son = B father = true)p(father = true) P(son = B) P(son = B) = P(son = B and father = true) +P(son = B and father = false)

Paternity Suits Given: Therefore: Finally P(son = B father = true) = 0.5 P(son = B father = false) = 0.09 P(father = true) = 0.75 P(father = false) = 0.25 P(son = B and father = true) = 0.5 0.75 P(son = B and father = false) = 0.09 0.25 P(son = B) = 0.5 0.75 + 0.09 0.25 P(father = true son = B) = 0.50 0.75 0.5 0.75+0.09 0.25 = 0.9434

Paternity Suits - Impact of Prior P (father = true son = B) 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 Prior Belief We see that P(father = true son = B) 0.50 ρ = 0.5 ρ + 0.09 (1 ρ) where ρ is the prior belief that the child belongs to the father.

Roommate Example The simple version of Bayes Rule is just an application of the definition of conditional probability. Suppose that 90% of statistics majors are looking for a roommate, compared with 10% of econ majors and 50% of bio majors And suppose that Duke has only those three majors, with 25% of the students majoring in stats, 45% majoring in econ, and the rest in bio (with no double majors) Suppose your friend finds a roommate. What is the probability that your friend is a statistics major?

Roommate Example From the definition of conditional probability, For the numerator, P( stat roommate ) = P( stat and roommate ) P( roommate ) P( stat and roommate ) = P( roommate stat ) P( stat ) = 0.9 0.25 For the denominator, (let d denote looking for roommate), P(roommate) = P( (s and d) or (e and d) or (b and d) ) = P( s and d ) + P( e and d ) + P( b and d ) = P(d s) P(s) + P(d e) P(e) + P(d b) P(b) = 0.9 0.25 + 0.1 0.45 + 0.5 0.3

Roommate Example Putting everything together we have, P( stat roommate ) = P( stat and roommate ) P( roommate ) = 0.9 0.25 0.9 0.25 + 0.1 0.45 + 0.5 0.3 = 0.5357 We can similarly compute: P( econ roommate ) = P( econ and roommate ) P( roommate ) = 0.1 0.45 0.9 0.25 + 0.1 0.45 + 0.5 0.3 = 0.107

Roommate Example P( bio roommate ) = P( bio and roommate ) P( roommate ) = 0.5 0.3 0.9 0.25 + 0.1 0.45 + 0.5 0.3 = 0.357 Note that P(stat roommate) + P(econ roommate) + P(bio roommate) = 1 Reverse conditioning - do you see a pattern yet?

Law of Total Probability In general, let events A 1,..., A n be mutually exclusive and suppose that P(A 1 or A 2 or... or A n ) = 1. Then, Bayes formula is: P(A 1 B) = P(B A 1) P(A 1 ) P(B) = P(B A 1 ) P(A 1 ) n i=1 {P(B A i) P(A i )} Note the reversal from P(A i B) to P(B A i ) requires the calculation of P(B) using P(B A i ).

HIV Test ELISA is a test for HIV. If a person has HIV, ELISA has probability.997 of resulting in a positive test (true positive) If a person does not have HIV, then ELISA is negative with probability.985 (true negative) About 0.32% of the U.S. population has HIV Suppose you get an HIV test (e.g., as part of a marriage license). Your test comes back positive. What is the chance that you have HIV? We can use Bayes Rule. Let A 1 = {Have HIV} and let A 2 = {Do not have HIV}.

HIV Test P[A 1 pos ] = P[ pos A 1 ] P[A 1 ] P[ pos A 1 ] P[A 1 ] + P[ pos A 2 ] P[A 2 ] =.997.0032 (.997) (.0032) + (1.985) (1.0032) =.1758 So even though the test is positive, you are still unlikely to have HIV. This is because the background rate of HIV is quite low.

Buying a car: Bayes with Tree Diagram Suppose you need to buy a car. Based on previous experience you know that 30% of the cars have FAULTY transmission To be sure, you bring your car to a mechanic. Based on his past experience you know that He correctly detects cars with good transmission 80% of the cases He correctly detects car with bad transmission 90% of the cases What is the probability that you buy a faulty car if the mechanic says that is faulty? What is the probability that you buy a faulty car if the mechanic says that is good?

Buying a car: Bayes with Tree Diagram

Buying a Car: Bayes with Tree Diagram It turns out that True positive: P(F F ) = 27% 27%+14% = 66% False positive: P(F G ) = 3% 3%+56% = 5% True negative: P(G G ) = 56% 3%+56% = 95% False negative: P(G F ) = 14% 27%+14% = 34% The tree model is easy to be understood, but not practical when you have many cases!! Here we only have 2.

Buying a Car: Bayes without Tree Diagram P(F ) = 30% P(G) = 70% P( F F ) = 90% P( G F ) = 10% P( G G) = 80% P( F G) = 20% It turns out that P(F F ) = P(F G ) = P( F F )P(F ) P( F ) P( G F )P(F ) P( G ) = = 90% 30% 90% 30% + 20% 70% = 66% 10% 30% 10% 30% + 80% 70% = 5%

The Monty Hall Problem with Bayes Define O xy to be the event such that the TV show presenter opens door x if you pick y W y to be the event such that the door you pick, y, is the winning door Therefore you are interested in knowing Conditional probabilities tell us that P(W A O BA ). P(W A O BA ) = P(W A & O BA ) P(O BA ) = P(O BA W A )P(W A ) P(O BA )

The Monty Hall Problem with Bayes P(W A ) = 1 3 represents the probability that the door you picked is the winning one P(O BA W A ) = 1 2 is the probability that the TV show presenter opens door B given that door you picked, A, is the winning one [He could either open B or C with equal probability since he knows those are not winning doors] Finally the marginal distribution that the TV show presenter opens door B is P(O BA ) = P(W A & O BA ) + P(W B & O BA ) + P(W C & O BA ) = 1 6 + 0 + 1 3 = 3 6

The Monty Hall Problem with Bayes Note that P(W A ) represents our prior distribution (personal probability) Opening door B represents the data that are going to update our personal probability P(W A O BA ) = 1 2 1 3 3 6 = 1 3 P(W B O BA ) = 0 1 3 3 6 P(W C O BA ) = 1 1 3 3 6 = 0 = 2 3