14
Say “Yes” to Bayes A hopefully helpful handout by Tristan Hubsch Strayer University

Say “Yes” to Bayes

Embed Size (px)

DESCRIPTION

Say “Yes” to Bayes. A hopefully helpful handout by Tristan Hubsch Strayer University. The confusion. Whereas the calculation and the result proclaimed by the “vociferous” student in class were correctly answering the question of the homework problem, there was also a serious misunderstanding. - PowerPoint PPT Presentation

Citation preview

Page 1: Say “Yes” to Bayes

Say “Yes” to BayesSay “Yes” to Bayes

A hopefully helpful handoutby

Tristan HubschStrayer University

A hopefully helpful handoutby

Tristan HubschStrayer University

Page 2: Say “Yes” to Bayes

01/25/0601/25/06 22

The confusionThe confusion

Whereas the calculation and the result proclaimed by the “vociferous” student in class were correctly answering the question of the homework problem, there was also a serious misunderstanding.

At the point when the “initial” data for part c. were visible at the bottom of the screen and quoting P(win|Olson) = 0.60, someone called out that the answer was not 0.60, but 0.563.

Whereas the calculation and the result proclaimed by the “vociferous” student in class were correctly answering the question of the homework problem, there was also a serious misunderstanding.

At the point when the “initial” data for part c. were visible at the bottom of the screen and quoting P(win|Olson) = 0.60, someone called out that the answer was not 0.60, but 0.563.

Page 3: Say “Yes” to Bayes

01/25/0601/25/06 33

Confusion …cont’dConfusion …cont’d

Now, 0.563 indeed is the value of P(Olson|win), but not of P(win|Olson).

Both probabilities can be calculated from the table of joint and marginal probabilities, given in part b., which were visible on screen at the time of the discussion. (Which is why I refered to them and wrote the formula in terms of them on the board.)

Of course, the latter, P(win|Olson), was in fact also given as initial data.

Now, 0.563 indeed is the value of P(Olson|win), but not of P(win|Olson).

Both probabilities can be calculated from the table of joint and marginal probabilities, given in part b., which were visible on screen at the time of the discussion. (Which is why I refered to them and wrote the formula in terms of them on the board.)

Of course, the latter, P(win|Olson), was in fact also given as initial data.

Page 4: Say “Yes” to Bayes

01/25/0601/25/06 44

Confusion …cont’dConfusion …cont’d

So, whoever was of the opinion, stated by the “vociferous” student, that the text's result for the answer to the question in part c was correct, was indeed correct.

Also, whoever was of the opinion, stated by the “vociferous” student, that the formula I wrote on the board was wrong, was wrong.

So, six of one, half a dozen of the other…

So, whoever was of the opinion, stated by the “vociferous” student, that the text's result for the answer to the question in part c was correct, was indeed correct.

Also, whoever was of the opinion, stated by the “vociferous” student, that the formula I wrote on the board was wrong, was wrong.

So, six of one, half a dozen of the other…

Page 5: Say “Yes” to Bayes

01/25/0601/25/06 55

Confusion …cont’dConfusion …cont’d

However, I should have recognized this equivocation immediately, and asked you to clearly state which of the two (very different!) statements you endorse…

…but didn’t. So, each Student on the list will get the 5 points

for standing by their conviction, even if it was the second (wrong) one.

In turn, I get to make this presentation.

However, I should have recognized this equivocation immediately, and asked you to clearly state which of the two (very different!) statements you endorse…

…but didn’t. So, each Student on the list will get the 5 points

for standing by their conviction, even if it was the second (wrong) one.

In turn, I get to make this presentation.

Page 6: Say “Yes” to Bayes

01/25/0601/25/06 66

Lawyers, revisitedLawyers, revisited

So, let’s revisit problem 11:P(A) = 0.40 and P(O) = 0.60.

These will soon turn up as “marginal”.P(w|A) = 0.70, so P(l|A) = 0.30; also

P(w|O) = 0.60, so P(l|O) = 0.40.These are conditional probabilities, with the lawyer firm as the condition.

So, let’s revisit problem 11:P(A) = 0.40 and P(O) = 0.60.

These will soon turn up as “marginal”.P(w|A) = 0.70, so P(l|A) = 0.30; also

P(w|O) = 0.60, so P(l|O) = 0.40.These are conditional probabilities, with the lawyer firm as the condition.

Page 7: Say “Yes” to Bayes

01/25/0601/25/06 77

Lawyers, revisited …cont’d

Lawyers, revisited …cont’d

The joint probabilities are obtained usingP(r&F) = P(r|F)·P(F),

where “r” stands for the result, and “F” for the lawyer firm in question.

Doggedly substituting “r → w” and then“r → l”, and “F → A” and then “F → O”, provides the table for part b.:

The joint probabilities are obtained usingP(r&F) = P(r|F)·P(F),

where “r” stands for the result, and “F” for the lawyer firm in question.

Doggedly substituting “r → w” and then“r → l”, and “F → A” and then “F → O”, provides the table for part b.:

Page 8: Say “Yes” to Bayes

01/25/0601/25/06 88

Lawyers, revisited …cont’d

Lawyers, revisited …cont’d

MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome

P(w&A)P(w&A)P(w&O)P(w&O)

P(l&A)P(l&A)P(l&O)P(l&O)

P(w)P(w) P(l)P(l)

P(A)P(A)P(O)P(O)

All conditional probabilities can now be obtained by turningthe previous formula around:All conditional probabilities can now be obtained by turningthe previous formula around:

P(r|F) = P(r&F) / P(F),P(r|F) = P(r&F) / P(F),

Page 9: Say “Yes” to Bayes

01/25/0601/25/06 99

Lawyers, revisited …cont’d

Lawyers, revisited …cont’d

P(r|F) = P(r&F)/P(F)= P(F&r)/P(F)= P(F|r)·P(r)/[P(F&r1)+P(F&r2)+…]= P(F|r)·P(r)/[P(F|r1)·P(r1)+P(F&r2)·P(r2)+…]

but also P(F|r) = P(F&r)/P(r)

= P(r&F)/P(r)= P(r|F)·P(F)/[P(r&F1)+P(r&F2)+…] = P(r|F)·P(F)/[P(r|F1)·P(F1)+P(r|F2)·P(F2)+…]

P(r|F) = P(r&F)/P(F)= P(F&r)/P(F)= P(F|r)·P(r)/[P(F&r1)+P(F&r2)+…]= P(F|r)·P(r)/[P(F|r1)·P(r1)+P(F&r2)·P(r2)+…]

but also P(F|r) = P(F&r)/P(r)

= P(r&F)/P(r)= P(r|F)·P(F)/[P(r&F1)+P(r&F2)+…] = P(r|F)·P(F)/[P(r|F1)·P(F1)+P(r|F2)·P(F2)+…]

Bayes’ formulaBayes’ formula

marginal probabilitymarginal probability

= sum of joint probabilities= sum of joint probabilities

joint probabilityjoint probability

Page 10: Say “Yes” to Bayes

01/25/0601/25/06 1010

P(w|A) = P(w&A)/P(A)

P(w|O) = P(w&O)/P(O)

P(l|A) = P(l&A)/P(A)

P(l|O) = P(l&O)/P(O)

P(w|A) = P(w&A)/P(A)

P(w|O) = P(w&O)/P(O)

P(l|A) = P(l&A)/P(A)

P(l|O) = P(l&O)/P(O)

MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome

Lawyers, revisited …cont’d

Lawyers, revisited …cont’d

=(0.28)/(0.40)=0.70

=(0.36)/(0.60)=0.60

=(0.12)/(0.40)=0.30

=(0.24)/(0.60)=0.40

given

inferred

Page 11: Say “Yes” to Bayes

01/25/0601/25/06 1111

Indeed, I had on the board:

P(w|O) = [P(O|w)·P(w)]

  /[P(O|w)·P(w)+P(O|l)·P(l)]

= P(O&w)/[P(O&w)+P(O&l)]

= P(w&O)/P(O)

Indeed, I had on the board:

P(w|O) = [P(O|w)·P(w)]

  /[P(O|w)·P(w)+P(O|l)·P(l)]

= P(O&w)/[P(O&w)+P(O&l)]

= P(w&O)/P(O)

MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome

Lawyers, revisited …cont’d

Lawyers, revisited …cont’d

=(0.36)/(0.60)=0.60

…as given; so, it cannot be wrong!

Page 12: Say “Yes” to Bayes

01/25/0601/25/06 1212

And, we also have:

P(A|w) = P(A&w)/P(w)

P(O|w) = P(O&w)/P(w)

P(A|l) = P(A&l)/P(l)

P(O|l) = P(O&l)/P(l)

And, we also have:

P(A|w) = P(A&w)/P(w)

P(O|w) = P(O&w)/P(w)

P(A|l) = P(A&l)/P(l)

P(O|l) = P(O&l)/P(l)

MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome

Lawyers, revisited …cont’d

Lawyers, revisited …cont’d

=(0.28)/(0.64)=0.438

=(0.36)/(0.64)=0.563

=(0.12)/(0.36)=0.333

=(0.24)/(0.36)=0.667

asked

Page 13: Say “Yes” to Bayes

01/25/0601/25/06 1313

In summary:

P(O|w) = P(O&w)/P(w) = (0.36)/(0.64) = 0.563

was the correct answer to the question in 11c.

P(w|O) = P(w&O)/P(O) = (0.36)/(0.60) = 0.60

is a correct recalculation of a given value, from the data listed in part

b., for which the more elaborate Bayesian formula was on the board—

not wrong; merely answering a different question.

In summary:

P(O|w) = P(O&w)/P(w) = (0.36)/(0.64) = 0.563

was the correct answer to the question in 11c.

P(w|O) = P(w&O)/P(O) = (0.36)/(0.60) = 0.60

is a correct recalculation of a given value, from the data listed in part

b., for which the more elaborate Bayesian formula was on the board—

not wrong; merely answering a different question.

MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome MarginalFirm Win Lose Probabilities

Abercrombie 0.28 0.12 0.40Olson 0.36 0.24 0.60

MarginalProbabilities 0.64 0.36 1.00

Outcome

Resolution?Resolution?

Page 14: Say “Yes” to Bayes

01/25/0601/25/06 1414

Do we have all the ducks in a row now?Do we have all the ducks in a row now?