Conditional Probability: Ds1 - Ag
Conditional Probability: Ds1 - Ag
Conditional Probability: Ds1 - Ag
Probability
DS1 - AG
Today’s lecture
Probability trees
Statistical independence
Joint probability
Conditional probability
Marginal probability
Bayes’ Rule
Probability example
Sample space: the set of all possible outcomes.
For example, in genetics, if both the mother and father carry one
copy of a recessive disease-causing mutation (d), there are three
possible outcomes (the sample space):
§ child is not a carrier (DD)
§ child is a carrier (Dd)
§ child has the disease (dd).
P(♂D=.5) P(dD)=.5*.5=.25
P(♀d=.5)
P(♂d=.5) P(dd)=.5*.5=.25
______________
1.0
Rule of thumb: in probability, “and”
means multiply, “or” means add
Independence
Formal definition: A and B are independent if and only if
P(A&B)=P(A)*P(B)
P(♂D=.5) P(dD)=.5*.5=.25
P(♀d=.5)
P(♂d=.5) P(dd)=.5*.5=.25
______________
1.0
\ Dependent!
Law of total probability
P(test +) = P(test + /HIV+)P(HIV+) + P(test + /HIV-)P(HIV-)
P(BC|test+)=.0027/(.0027+.10967)=2.4%
Bayes’ rule
Bayes’ Rule: derivation
Definition:
Let A and B be two events with P(B) ¹ 0. The conditional probability
of A given B is:
The idea: if we are given that the event B occurred, the relevant sample space is
reduced to B {P(B)=1 because we know B is true} and conditional probability becomes
a probability measure on B.
Bayes’ Rule: derivation
P( A & B)
P( A / B) =
P( B)
can be re-arranged to:
P( A & B) = P( A / B) P( B)
and, since also:
P( A & B)
P( B / A) = \ P( A & B) = P( B / A) P( A)
P( A)
P( A / B) P( B) = P( A & B) = P( B / A) P( A)
P( A / B) P( B) = P( B / A) P( A)
P( B / A) P( A)
\ P( A / B) =
P( B)
Bayes’ Rule:
P( B / A) P( A)
P( A / B) =
P( B)
OR
P( B / A) P( A)
P( A / B) = From the
P( B / A) P( A) + P( B / ~ A) P(~ A)
“Law of Total
Probability”
Bayes’ Rule:
Why do we care??
Why is Bayes’ Rule useful??
It turns out that sometimes it is very useful to be able to “flip”
conditional probabilities. That is, we may know the probability of A
given B, but the probability of B given A may not be obvious. An
example will help…
In-Class Exercise
If HIV has a prevalence of 3% in San Francisco, and
a particular HIV test has a false positive rate of
.001 and a false negative rate of .01, what is the
probability that a random person who tests
positive is actually infected (also known as
“positive predictive value”)?
Answer: using probability
tree
P(test +)=.99 P (+, test +)=.0297
P(+)=.03
P(test - = .01)
P(+, test -)=.003
P(test +) = .001
P(-, test +)=.00097
P(-)=.97
P(high-risk/accident)=
P(accident/high risk)*P(high risk)/P(accident)
=.40(.20)/.16 = 50%
P(accident/LR)=.1
P(low risk)=.80 P(accident, low risk)=.08
P(high risk/accident)=.08/.16=50%