Transcript Live stat

Bayes’ Law (full form, n = 2)
P (B | A ) =
P ( A | B ) P (B )
P ( A | B ) P ( B ) + P ( A | B c ) P (B c )
Example:
Two similar bat species, B1 and B2, occupy both highland (A) and lowland (Ac) areas.
prior probabilities
• Species B1 makes up 90% of the population; species B2, 10%. P(B1) = .9, P(B2) = .1
c
• 20% of spec B1 live in the highlands, 80% in the lowlands. P(A|B1) = .2, P(A |B1) = .8
• 60% of spec B2 live in the highlands, 40% in the lowlands. P(A|B2) = .6, P(Ac|B2) = .4
What is the probability that a randomly caught bat belongs to each species, if it is
posterior probabilities
caught in the highlands? In the lowlands?
B1
B2 (= B1
P ( A | B1 ) P (B1 )
P (B1 | A) =
P ( A | B1 ) P (B1 ) + P ( A | B2 ) P (B2 )
c)
A
P ( A | B2 ) P (B2 )
P (B2 | A) =
P ( A | B1 ) P (B1 ) + P ( A | B2 ) P (B2 )
Ac
.90
.10
1
P(A)
“LAW OF TOTAL PROBABILITY”
Bayes’ Law (full form, n = 2)
P (B | A ) =
P ( A | B ) P (B )
P ( A | B ) P ( B ) + P ( A | B c ) P (B c )
Example:
Two similar bat species, B1 and B2, occupy both highland (A) and lowland (Ac) areas.
prior probabilities
• Species B1 makes up 90% of the population; species B2, 10%. P(B1) = .9, P(B2) = .1
• 20% of spec B1 live in the highlands, 80% in the lowlands. P(A|B1) = .2, P(Ac|B1) = .8
• 60% of spec B2 live in the highlands, 40% in the lowlands. P(A|B2) = .6, P(Ac|B2) = .4
What is the probability that a randomly caught bat belongs to each species, if it is
posterior probabilities
caught in the highlands? In the lowlands?
B1
B2 (= B1
P ( A | B1 ) P (B1 )
P (B1 | A) =
P ( A | B1 ) P (B1 ) + P ( A | B2 ) P (B2 )
c)
A
P ( A | B2 ) P (B2 )
P (B2 | A) =
P ( A | B1 ) P (B1 ) + P ( A | B2 ) P (B2 )
Ac
.90
.10
1
P(A)
“LAW OF TOTAL PROBABILITY”
Bayes’ Law (full form, n = 2)
P (B | A ) =
P ( A | B ) P (B )
P ( A | B ) P ( B ) + P ( A | B c ) P (B c )
Example:
Two similar bat species, B1 and B2, occupy both highland (A) and lowland (Ac) areas.
prior probabilities
• Species B1 makes up 90% of the population; species B2, 10%. P(B1) = .9, P(B2) = .1
• 20% of spec B1 live in the highlands, 80% in the lowlands. P(A|B1) = .2, P(Ac|B1) = .8
• 60% of spec B2 live in the highlands, 40% in the lowlands. P(A|B2) = .6, P(Ac|B2) = .4
What is the probability that a randomly caught bat belongs to each species, if it is
posterior probabilities
caught in the highlands? In the lowlands?
B1
A
B2 (= B1
(.2)(.9)
P (B1 | A) =
(.2)(.9) + (.6)(.1)
c)
(.2)(.9)
(.6)(.1)
.90
.10
(.6)(.1)
P (B2 | A) =
(.2)(.9) + (.6)(.1)
Ac
1
P(A)
“LAW OF TOTAL PROBABILITY”
Bayes’ Law (full form, n = 2)
P (B | A ) =
P ( A | B ) P (B )
P ( A | B ) P ( B ) + P ( A | B c ) P (B c )
Example:
Two similar bat species, B1 and B2, occupy both highland (A) and lowland (Ac) areas.
prior probabilities
• Species B1 makes up 90% of the population; species B2, 10%. P(B1) = .9, P(B2) = .1
• 20% of spec B1 live in the highlands, 80% in the lowlands. P(A|B1) = .2, P(Ac|B1) = .8
• 60% of spec B2 live in the highlands, 40% in the lowlands. P(A|B2) = .6, P(Ac|B2) = .4
What is the probability that a randomly caught bat belongs to each species, if it is
posterior probabilities
caught in the highlands? In the lowlands?
B1
A
B2 (= B1
.18
.06
.90
.10
(.2)(.9)
.18
P (B1 | A) =
=
(.2)(.9) + (.6)(.1) .18 +.06
c)
(.6)(.1)
.06
P (B2 | A) =
=
(.2)(.9) + (.6)(.1) .18 +.06
Ac
1
P(A)
“LAW OF TOTAL PROBABILITY”
Bayes’ Law (full form, n = 2)
P (B | A ) =
P ( A | B ) P (B )
P ( A | B ) P ( B ) + P ( A | B c ) P (B c )
Example:
Two similar bat species, B1 and B2, occupy both highland (A) and lowland (Ac) areas.
prior probabilities
• Species B1 makes up 90% of the population; species B2, 10%. P(B1) = .9, P(B2) = .1
• 20% of spec B1 live in the highlands, 80% in the lowlands. P(A|B1) = .2, P(Ac|B1) = .8
• 60% of spec B2 live in the highlands, 40% in the lowlands. P(A|B2) = .6, P(Ac|B2) = .4
What is the probability that a randomly caught bat belongs to each species, if it is
posterior probabilities
caught in the highlands? In the lowlands?
B1
A
B2 (= B1
(.2)(.9)
.18
P (B1 | A) =
=
(.2)(.9) + (.6)(.1) .24
c)
.18
.06
.24
(.6)(.1)
.06
P (B2 | A) =
=
(.2)(.9) + (.6)(.1) .24
.90
.10
1
P(A)
“LAW OF TOTAL PROBABILITY”
Ac
Bayes’ Law (full form, n = 2)
P (B | A ) =
P ( A | B ) P (B )
P ( A | B ) P ( B ) + P ( A | B c ) P (B c )
Example:
Two similar bat species, B1 and B2, occupy both highland (A) and lowland (Ac) areas.
prior probabilities
• Species B1 makes up 90% of the population; species B2, 10%. P(B1) = .9, P(B2) = .1
• 20% of spec B1 live in the highlands, 80% in the lowlands. P(A|B1) = .2, P(Ac|B1) = .8
• 60% of spec B2 live in the highlands, 40% in the lowlands. P(A|B2) = .6, P(Ac|B2) = .4
What is the probability that a randomly caught bat belongs to each species, if it is
posterior probabilities
caught in the highlands? In the lowlands?
B1
A
.18
B2 (= B1
.06
Ac
.90
.10
(.2)(.9)
.18
P (B1 | A) =
=
= .75
(.2)(.9) + (.6)(.1) .24
c)
.24
(.6)(.1)
.06
P (B2 | A) =
=
= .25
(.2)(.9) + (.6)(.1) .24
In the highlands…
•1B1 decreases from a prior of 90% to a posterior of 75%
• B2 increases from a prior of 10% to a posterior of 25%
Bayes’ Law (full form, n = 2)
P (B | A ) =
P ( A | B ) P (B )
P ( A | B ) P ( B ) + P ( A | B c ) P (B c )
Example:
Two similar bat species, B1 and B2, occupy both highland (A) and lowland (Ac) areas.
prior probabilities
• Species B1 makes up 90% of the population; species B2, 10%. P(B1) = .9, P(B2) = .1
• 20% of spec B1 live in the highlands, 80% in the lowlands. P(A|B1) = .2, P(Ac|B1) = .8
• 60% of spec B2 live in the highlands, 40% in the lowlands. P(A|B2) = .6, P(Ac|B2) = .4
What is the probability that a randomly caught bat belongs to each species, if it is
posterior probabilities
caught in the highlands? In the lowlands?
A
B1
B2 (= B1c)
.18
.06
.72
P (B1 | A ) =
= .947
.76
c
.24
.04
P (B2 | A ) =
= .053
.76
c
Ac
.72
.04
.90
.10
.76
In the lowlands…
•1B1 increases from a prior of 90% to a posterior of 94.7%
• B2 decreases from a prior of 10% to a posterior of 5.3%
Bayes’ Law (full form, n = 2)
P (B | A ) =
P ( A | B ) P (B )
P ( A | B ) P ( B ) + P ( A | B c ) P (B c )
Example:
Two similar bat species, B1 and B2, occupy both highland (A) and lowland (Ac) areas.
prior probabilities
• Species B1 makes up 90% of the population; species B2, 10%. P(B1) = .9, P(B2) = .1
• 20% of spec B1 live in the highlands, 80% in the lowlands. P(A|B1) = .2, P(Ac|B1) = .8
• 60% of spec B2 live in the highlands, 40% in the lowlands. P(A|B2) = .6, P(Ac|B2) = .4
What is the probability that a randomly caught bat belongs to each species, if it is
caught in the highlands? In the lowlands?
posterior probabilities
Exercise:
Species B1 – with a prior prob of ??? –
• ??? to a posterior of ??? in the highlands
• ??? to a posterior of ??? in the lowlands.
Species B2 – with a prior prob of ??? –
• ??? to a posterior of ??? in the highlands
• ??? to a posterior of ??? in the lowlands.
P(B1 | A) = .75 P(B1 | Ac ) = .947
P(B2 | A) = .25 P(B2 | Ac ) = .053
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
Thiamine
Riboflavin
B1
B2
Niacin
B3
No B deficiency
B4
“10% of pop is B1-deficient (only), 20% is B2-deficient (only), and
30% is B3-deficient (only). The remaining 40% is not B-deficient.”
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Thiamine
Riboflavin
Niacin
B1
B2
P(A ∩ B1)
P(A ∩ B2)
P(A ∩ B3)
P(A ∩ B4)
P(Ac ∩ B1)
P(Ac ∩ B2)
P(Ac ∩ B3)
P(Ac ∩ B4)
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
B3
No B deficiency
B4
To find these intersection probabilities, we need more information!
1.00
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Also
given…
Thiamine
Riboflavin
Niacin
B1
B2
P(A ∩ B1)
P(A ∩ B2)
P(A ∩ B3)
P(A ∩ B4)
P(Ac ∩ B1)
P(Ac ∩ B2)
P(Ac ∩ B3)
P(Ac ∩ B4)
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
B3
No B deficiency
B4
“Alcoholics comprise 35%, 30%, 25%, and 20%
of the B1, B2, B3, B4 groups, respectively.”
1.00
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Also
given…
Thiamine
Riboflavin
B1
B2
P(A ∩ B1)
P(A ∩ B2)
P(A ∩ B3)
P(A ∩ B4)
P(Ac ∩ B1)
P(Ac ∩ B2)
P(Ac ∩ B3)
P(Ac ∩ B4)
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
P(A | B3) = .25
P(A | B4) = .20
P(A | B1) = .35
P(A | B2) = .30
Niacin
B3
No B deficiency
B4
1.00
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Also
given…
Recall:
Thiamine
Riboflavin
B1
B2
P(A ∩ B1)
P(A ∩ B2)
P(A ∩ B3)
P(A ∩ B4)
P(Ac ∩ B1)
P(Ac ∩ B2)
P(Ac ∩ B3)
P(Ac ∩ B4)
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
P(A | B3) = .25
P(A | B4) = .20
P(A | B1) = .35
P(A | B2) = .30
Niacin
No B deficiency
B3
P(A ∩ B) = P(A | B) P(B)
B4
1.00
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Also
given…
Recall:
Thiamine
Riboflavin
B1
B2
.10.035
 .35
.20.060
 .30
.30.075
 .25
.40.080
 .20
P(Ac ∩ B1)
P(Ac ∩ B2)
P(Ac ∩ B3)
P(Ac ∩ B4)
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
P(A | B3) = .25
P(A | B4) = .20
P(A | B1) = .35
P(A | B2) = .30
Niacin
No B deficiency
B3
P(A ∩ B) = P(A | B) P(B)
B4
1.00
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Thiamine
Riboflavin
Niacin
B1
B2
.10.035
 .35
.20.060
 .30
.30.075
 .25
.40.080
 .20
.065
.140
.225
.320
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
B3
No B deficiency
B4
1.00
Posterior
probabilities
P(B1 | A) = ?
P(B2 | A) = ?
P(B3 | A) = ?
P(B4 | A) = ?
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Thiamine
Riboflavin
Niacin
B1
B2
.035
.060
.075
.080
P(A) = .25
.065
.140
.225
.320
P(Ac) = .75
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
1.00
B3
No B deficiency
B4
Posterior
probabilities
P(B1 ∩ A)
P(B1 | A) = ?
P(B2 | A) = ?
P(A)
P(B3 | A) = ?
P(B4 | A) = ?
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Thiamine
Riboflavin
Niacin
B1
B2
.035
.060
.075
.080
P(A) = .25
.065
.140
.225
.320
P(Ac) = .75
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
1.00
No B deficiency
B3
B4
Posterior
probabilities
.035
P(B1 | A) =
.25
.060
P(B2 | A) =
.25
.075
P(B3 | A) =
.25
P(B4 | A) =
.080
.25
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Thiamine
Riboflavin
B1
B2
.035
.060
.075
.080
P(A) = .25
.065
.140
.225
.320
P(Ac) = .75
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
1.00
INCREASE
P(B1 | A) = .14
INCREASE
P(B2 | A) = .24
Niacin
No B deficiency
B3
NO CHANGE;
A and B3 are
independent!
P(B3 | A) = .30
B4
DECREASE
Posterior
probabilities
P(B4 | A) = .32
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
A=
Alcoholic
Ac = Not
Alcoholic
Prior probs
Thiamine
Riboflavin
Niacin
B1
B2
.035
.060
.075
.080
P(A) = .25
.065
.140
.225
.320
P(Ac) = .75
P(B1) = .10
P(B2) = .20
P(B3) = .30
P(B4) = .40
1.00
No B deficiency
B3
Posterior
probabilities
Exercise:
P(B1 | Ac) = ??
B4
P(B2 | Ac) = ??
P(B3 | Ac) = ??
P(B4 | Ac) = ??
Example: Vitamin B-complex deficiency among general population
Assume B1, B2, B3, B4 “partition” the population, i.e., they are disjoint and exhaustive.
Thiaminedeficient
C2
C5
C4
Alcoholic
C2
C3
C6
C3
Nondeficient
C7
Niacindeficient
C1
C1
Riboflavindeficient
C4
C5
C6
C7
C8
C8
A
(Yes)
etc.
Ac
(No)