priors, total probability, expectation, multiple trials€¦ · recall: medical diagnosis suppose:...

47
Priors, Total Probability, Expectation, Multiple Trials CS 2800: Discrete Structures, Fall 2014 Sid Chaudhuri

Upload: others

Post on 16-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Priors, Total Probability, Expectation, Multiple Trials

CS 2800: Discrete Structures, Fall 2014

Sid Chaudhuri

Page 2: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Bayes' Theorem

● Given: prior probabilities of hypotheses, and the probability that each hypothesis produces the observed evidence

● Produces: probability of a particular hypothesis, given the observed evidence.

P(A∣B)=P(B∣A)P(A)

P (B)

Page 3: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Estimating P(B)

● Total Probability Theorem: If A1, A

2, A

3, … is a

(finite or countably infinite) partition of S (they are pairwise disjoint subsets and their union is S), and B is any event in S, then

P(B) = P(∪i (B ∩ A

i)) (Set theory)

= ∑i P(B ∩ A

i) (Axiom 3)

= ∑i P(B | A

i) P(A

i) (Definition)

Page 4: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

S

A1

A2

A3

Page 5: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

S

A1

A2

A3

B

B∩A1

B∩A2

B∩A3

Page 6: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Recall: Medical Diagnosis

● Suppose:– 1 in 1000 people carry a disease, for which there is a

pretty reliable test– Probability of a false negative (carrier tests negative) is

1% (so probability of carrier testing positive is 99%)– Probability of a false positive (non-carrier tests

positive) is 5%● A person just tested positive. What are the

chances (s)he is a carrier of the disease?

Page 7: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

A counter-intuitive result

● The reliable test gives a positive result, but the chance the patient has the disease is only about 2%.

● Informally: the rarity of the disease outweighs the small chance of error.

Page 8: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Should we stop worrying?

Scrubs

Page 9: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Should we stop worrying?

● No.

Page 10: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Should we stop worrying?

● No.● The consequences of being wrong are pretty

severe.

Page 11: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Should we stop worrying?

● No.● The consequences of being wrong are pretty

severe.● How can we better interpret this result?

Page 12: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Possibilities

● You live

Page 13: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Possibilities

● You live ● You die(let's assume the disease is always fatal)

Page 14: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Possibilities

● You live

● Improvement to your current state: +1

(if we agree living longer can enrich our life experience)

● You die(let's assume the disease is always fatal)

Page 15: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Possibilities

● You live

● Improvement to your current state: +1

(if we agree living longer can enrich our life experience)

● You die(let's assume the disease is always fatal)

● Improvement to your current state: -1000000

Page 16: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Possibilities

● You live

● Improvement to your current state: +1

(if we agree living longer can enrich our life experience)

● You die(let's assume the disease is always fatal)

● Improvement to your current state: -1000000

(Yes, I'm pulling these numbers out of a (non-probabilistic) posterior, but they're illustrative)

Page 17: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Expectation

P(Living | Positive) × Utility of living+ P(Dying | Positive) × Utility of dying

Page 18: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Expectation

P(Living | Positive) × Utility of living+ P(Dying | Positive) × Utility of dying

= 0.986 × 1 + 0.0194 × -1000000

Page 19: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Expectation

P(Living | Positive) × Utility of living+ P(Dying | Positive) × Utility of dying

= 0.986 × 1 + 0.0194 × -1000000

≈ -19399

Page 20: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Expectation

P(Living | Positive) × Utility of living+ P(Dying | Positive) × Utility of dying

= 0.986 × 1 + 0.0194 × -1000000

≈ -19399

The exact value isn't meaningful in this example. Just note that despite a small probability of a bad outcome, the highly negative weighted average suggests we might have reason to be worried.

Page 21: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

● The expectation (or expected outcome, or expected value...) of an experiment with possible outcomes {x

1, x

2, x

3, ...} is

E(x) = ∑i P(x

i) x

i

Expectation

Page 22: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

● The expectation (or expected outcome, or expected value...) of an experiment with possible outcomes {x

1, x

2, x

3, ...} is

E(x) = ∑i P(x

i) x

i

● If the outcomes are not numbers (or more generally, not elements of a vector space) which can be meaningfully added/scaled, we can assign them numeric “utility” values u(x), and inspect the “expected utility” ∑

i P(x

i) u(x

i)

Expectation

Page 23: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Expectedweather

P(cloudy)

P(rainy) P(snow)

P(sunny)

Expected Weather in Ithaca

Page 24: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

P(cloudy)

P(rainy) P(snow)

P(sunny)

Expected Weather in SoCal

Expectedweather

Page 25: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Expectation

● Think of it as a center of mass, with the probabilities being the masses and the outcomes/utilities their (point) positions

● A useful statistic, but only a guide, not a complete picture of human decision-making

Gold Medal Bodies

Page 26: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test
Page 27: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test
Page 28: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test
Page 29: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Tests● First test: T

1 = { Positive, Negative }

● Second test: T2 = { Positive, Negative }

Ignoring patientstatus for themoment

Page 30: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Tests● First test: T

1 = { Positive, Negative }

● Second test: T2 = { Positive, Negative }

● T = T1 × T

2

= { (Positive, Positive), (Positive, Negative), (Negative, Positive), (Negative, Negative) }

Ignoring patientstatus for themoment

Page 31: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Tests● First test: T

1 = { Positive, Negative }

● Second test: T2 = { Positive, Negative }

● T = T1 × T

2

= { (Positive, Positive), (Positive, Negative), (Negative, Positive), (Negative, Negative) }

● Positive in first test = A1

= ?

Ignoring patientstatus for themoment

Page 32: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Tests● First test: T

1 = { Positive, Negative }

● Second test: T2 = { Positive, Negative }

● T = T1 × T

2

= { (Positive, Positive), (Positive, Negative), (Negative, Positive), (Negative, Negative) }

● Positive in first test = A1

= { (Positive, Positive), (Positive, Negative) }

Ignoring patientstatus for themoment

Page 33: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Tests● First test: T

1 = { Positive, Negative }

● Second test: T2 = { Positive, Negative }

● T = T1 × T

2

= { (Positive, Positive), (Positive, Negative), (Negative, Positive), (Negative, Negative) }

● Positive in first test = A1

= { (Positive, Positive), (Positive, Negative) }

● Positive in second test = A2

= ?

Ignoring patientstatus for themoment

Page 34: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Tests● First test: T

1 = { Positive, Negative }

● Second test: T2 = { Positive, Negative }

● T = T1 × T

2

= { (Positive, Positive), (Positive, Negative), (Negative, Positive), (Negative, Negative) }

● Positive in first test = A1

= { (Positive, Positive), (Positive, Negative) }

● Positive in second test = A2

= { (Positive, Positive), (Negative, Positive) }

Ignoring patientstatus for themoment

Page 35: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Tests

● D = { Carrier, NotCarrier }

● Sample space of first test S1 = T

1 × D

● Sample space of second test S2 = T

2 × D

● Full sample space S = T1 × T

2 × D

● E.g. event that first test is positive, second is unknown, and person is a carrier:

{ (Positive, Positive, Carrier), (Positive, Negative, Carrier) }

Page 36: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Tests

● E.g. event that person is a carrier:

{ (Positive, Positive, Carrier), (Positive, Negative, Carrier), (Negative, Positive, Carrier), (Negative, Negative, Carrier) }

● E.g. event that first test is positive:

{ (Positive, Positive, Carrier), (Positive, Negative, Carrier), (Positive, Positive, NotCarrier), (Positive, Negative, NotCarrier) }

Page 37: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Independent Tests

● We often make the assumption that the test results are independent of each other (but not, of course, of the patient's carrier status). In other words:

P(Test 1 positive and Test 2 positive | Carrier)= P(Test 1 positive | Carrier) P(Test 2 positive | Carrier)

and similarly for all other combinations.

Page 38: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Thought for the Day #1

When might this assumption be unjustified?

Page 39: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Independent Tests

P (C∣Y 1∩Y 2)

Page 40: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Independent Tests

P (C∣Y 1∩Y 2)

Is Carrier

First test positive(said “Yes”)

Second test positive(said “Yes”)

Page 41: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Independent TestsP (Y 1∩Y 2∣C ) P (C )

P (Y 1∩Y 2)P (C∣Y 1∩Y 2) = (Bayes' Theorem)

Page 42: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Independent TestsP (Y 1∩Y 2∣C ) P (C )

P (Y 1∩Y 2)

P (Y 1∩Y 2∣C ) P (C)P (Y 1∩Y 2∣C ) P (C )+P (Y 1∩Y 2∣C ' ) P (C ' )

P (C∣Y 1∩Y 2) =

=

(Bayes' Theorem)

(Total Probability Theorem)

Page 43: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Independent TestsP (Y 1∩Y 2∣C ) P (C )

P (Y 1∩Y 2)

P (Y 1∩Y 2∣C ) P (C)P (Y 1∩Y 2∣C ) P (C )+P (Y 1∩Y 2∣C ' ) P (C ' )

P (C∣Y 1∩Y 2)

P (Y 1∣C) P (Y 2∣C) P (C)P (Y 1∣C) P (Y 2∣C) P (C)+ P (Y 1∣C ' ) P (Y 2∣C ' ) P (C ')

=

=

=

(Bayes' Theorem)

(Total Probability Theorem)

(Independence assumption)

Page 44: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Independent TestsP (Y 1∩Y 2∣C ) P (C )

P (Y 1∩Y 2)

P (Y 1∩Y 2∣C ) P (C)P (Y 1∩Y 2∣C ) P (C )+P (Y 1∩Y 2∣C ' ) P (C ' )

P (C∣Y 1∩Y 2)

P (Y 1∣C) P (Y 2∣C) P (C)P (Y 1∣C) P (Y 2∣C) P (C)+ P (Y 1∣C ' ) P (Y 2∣C ' ) P (C ')

0.99×0.99×0.0010.99×0.99×0.001+0.05×0.05×0.999

=

=

=

=

(Bayes' Theorem)

(Total Probability Theorem)

(Independence assumption)

(From problem statement. The modelingassumption is that these values alsoapply to the product space)

Page 45: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Multiple Independent TestsP (Y 1∩Y 2∣C ) P (C )

P (Y 1∩Y 2)

P (Y 1∩Y 2∣C ) P (C)P (Y 1∩Y 2∣C ) P (C )+P (Y 1∩Y 2∣C ' ) P (C ' )

P (C∣Y 1∩Y 2)

P (Y 1∣C) P (Y 2∣C) P (C)P (Y 1∣C) P (Y 2∣C) P (C)+ P (Y 1∣C ' ) P (Y 2∣C ' ) P (C ')

0.99×0.99×0.0010.99×0.99×0.001+0.05×0.05×0.999

0.2818

=

=

=

=

=

(Bayes' Theorem)

(Total Probability Theorem)

(Independence assumption)

(From problem statement. The modelingassumption is that these values alsoapply to the product space)

Page 46: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Thought for the Day #2

Can you write down, in full, all the outcomes in each event involved in the previous slide? Note that these

events are all subsets of S = T1 × T

2 × D

Page 47: Priors, Total Probability, Expectation, Multiple Trials€¦ · Recall: Medical Diagnosis Suppose: – 1 in 1000 people carry a disease, for which there is a pretty reliable test

Thought for the Day #3

Can you work out the probability of the patient being a carrier, for every other combination of

test results?