presentation on Bayes

advertisement
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.
 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.
01/25/06
1
Confusion
…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.
01/25/06
2
Confusion
…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…
01/25/06
3
Confusion
…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. 
01/25/06
4
Lawyers, 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.
01/25/06
5
Lawyers, revisited
…cont’d
The joint probabilities are obtained using
P(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.:
01/25/06
6
Lawyers, revisited
Firm
Abercrombie
Olson
Marginal
Probabilities
P(w&A)
P(w&O)
Outcome
Win
Lose
0.28
0.12
0.36
0.24
0.64
…cont’d
Marginal
Probabilities
0.40
0.60
0.36
P(A)
P(O)
1.00
P(l&A)
P(l&O)
P(w)
P(l)
All conditional probabilities can now be obtained by turning
the previous formula around:
P(r|F) = P(r&F) / P(F),
01/25/06
7
Lawyers, revisited
…cont’d
joint probability
 P(r|F) = P(r&F)/P(F) marginal probability
= sum of joint probabilities
= 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)
Bayes’ formula
= 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)+…]
01/25/06
8
Lawyers, revisited
Firm
Abercrombie
Olson
Marginal
Probabilities
Outcome
Win
Lose
0.28
0.12
0.36
0.24
0.64
0.36
…cont’d
Marginal
Probabilities
0.40
0.60
1.00
 P(w|A) = P(w&A)/P(A) =(0.28)/(0.40)=0.70
 P(w|O) = P(w&O)/P(O) =(0.36)/(0.60)=0.60
 P(l|A) = P(l&A)/P(A) =(0.12)/(0.40)=0.30
given
inferred
 P(l|O) = P(l&O)/P(O) =(0.24)/(0.60)=0.40
01/25/06
9
Lawyers, revisited
Firm
Abercrombie
Olson
Marginal
Probabilities
Outcome
Win
Lose
0.28
0.12
0.36
0.24
0.64
0.36
…cont’d
Marginal
Probabilities
0.40
0.60
1.00
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) =(0.36)/(0.60)=0.60
01/25/06
…as given; so, it cannot be wrong!
10
Lawyers, revisited
Firm
Abercrombie
Olson
Marginal
Probabilities
Outcome
Win
Lose
0.28
0.12
0.36
0.24
0.64
0.36
…cont’d
Marginal
Probabilities
0.40
0.60
1.00
And, we also have:
 P(A|w) = P(A&w)/P(w) =(0.28)/(0.64)=0.438
 P(O|w) = P(O&w)/P(w) =(0.36)/(0.64)=0.563 asked
 P(A|l) = P(A&l)/P(l) =(0.12)/(0.36)=0.333
 P(O|l) = P(O&l)/P(l) =(0.24)/(0.36)=0.667
01/25/06
11
Resolution?
Firm
Abercrombie
Olson
Marginal
Probabilities
Outcome
Win
Lose
0.28
0.12
0.36
0.24
0.64
Marginal
Probabilities
0.40
0.60
0.36
1.00
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.
01/25/06
12
Do we have all the ducks in a row now?

01/25/06
13
Download