T02640010220114056Bayes Theorem & Bayes Nets_examples
Transcript of T02640010220114056Bayes Theorem & Bayes Nets_examples
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
1/39
Solution Examples2012dks
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
2/39
2
The notion of conditional probability: P(H\E)
Let:
P(Hi\E) =the probability that hypothesis Hi is true given evidence E
P(E\Hi) =the probability that we will observe evidence E
given that hypothesis i is true
P(Hi) =the a priori probability that hypothesis i is true in theabsence
of specific evidence.
k =the number of possible hypotheses
Bayes' theorem then states that
Further, if we add a new piece of evidence, e, then
P(H\E,e)= P(H\E ). P(e \E, H)
P(e\E)
Bayes Theorem
k
1n)n).P(HnH\P(E
)i
).P(Hi
H\P(EE)\
iP(H
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
3/39
Conditional Probability
Definition:
Therefore,
can also be obtained as
3
)(
)()|(
Bp
BApBAp
)( BAp
)|()()|()()( ABpApBApBpBAp
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
4/39
Bayess theorem
is a mechanism for combining new andexisting evidence, usually given asubjective probabilities.
used to revise existing prior probabilitiesbased on new information.
4
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
5/39
Bayess theorem
The probability of concluding the hypothesis(hi), given the evidence (e) has the form of aconditional probability:
5
ehp i |
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
6/39
Bayes Formula
6
2211
11
hpe|h+ phpe|hp
hpe|hp
ephpe|hp
ehp iii |
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
7/39
Examples 1
7
Assume that University ABC has an expert system to
consult the administration officers about studentsadmission.
There are two hypothesis:
h1= accept the student and
h2 = reject the student.
The evidence that can be used in both of thehypothesis is e = the student has good grade.
It was revealed that the system accepts 40% of thestudents who applied to the University.
p(h1) = 0.4
p(h2) = 0.6
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
8/39
Example 1
8
According to the Universitys records, of thosewho have been admitted, 85% of them hasgood grade, and 20% were rejected evenwith good grade.
Consequently, the conditional probabilitiesare:
p(e|h1) = 0.85 p(e|h2) = 0.20
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
9/399
h1 = accept the student
p(h1 ) = 0.4
h2 = reject the student
p(h2 ) = 0.6
e = the student hasgood grade
p(e/h1 ) = 0.85 p(e/h2 ) = 0.20
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
10/3910
221111
hpe|h+ phpe|hp
hpe|hpp(h1|e) =
0.85 0.4
0.85 0.4 + 0.6 0.2
=
= 0.74
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
11/3911
p(h2|e) =
0.12+0.34
0.12=
0.26
2211
22
hpe|h+ phpe|hp
hpe|hp
=
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
12/39
Example 2
12
h1 = approve the loan
p(h1 ) = 0.70
h2 = reject the load
p(h2 ) = 0.30
e = the applicant hasa steady job
p(e/h1 ) = 0.80 p(e/h2 ) = 0.10
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
13/39
Example
13
2211
11
hpe|h+ phpe|hp
hpe|hpp(h1|e) =
= 0.95
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
14/39
Limitations of BayesianApproach
14
the number of required conditionalprobabilities increases as more pieces ofevidence are used in the system
even if we can obtain values for theprobabilities estimates, the calculations ofthe posterior probabilities will be too time
consuming
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
15/39
Kerjakan contoh-contoh tadi tanpamenggunakan rumus, akan tetapi gunakanlah
probability tree!
15
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
16/39
Soal 1: Student admission
P(h1) = 0.4 [accepted] P(h2) = 0.6 [rejected]
P(e/h1) = 0.85 e = good grade
P(e/h2) = 0.20
Soal 2: Loan Proposal
P(h1) = 0.70 [approved]
P(h2) = 0.30 [rejected]
P(e/h1) = 0.80 e = steady job
P(e/h2) = 0.10
16
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
17/39
S
a
0.4
e
0.85
e
0.15
a
0.6
e
0.20
e
0.80
h1 h2
e e
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
18/39
1000
10
8 2
990
95 895
(1) Choose a population big enough to guarantee that thenumbers you are dealing with are whole numbers.
(2) Break the population down into a tree diagram given theinformation available.
(3) Calculate the probability in the standard way: favorable
outcomes divided by total outcomes: 8/8+95 = .078
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
19/3919
1% of the population has X disease. A screening test accuratelydetects the disease for 90% of people with it. The test alsoindicates the disease for 15% of the people without it (the falsepositives). Suppose a person screened for the disease testspositive. What is the probability they actually have it?
popul
-ation
0.01
T T
D
T
0.99
D
T
0.850.150.100.90
[0,0571]
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
20/39
Another example
Lets consider another example of the use of BayesTheorem:
In a certain clinic 0.15 of the patients have got
the HIV virus. Suppose a blood test is carried out on a patient:
If the patient has got the virus the test will turn out
positive with probability 0.95 If the patient does not have the virus the test will turn
out positive with probability 0.02 [false positive]
20
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
21/39
If the test is positive what are theprobabilities that the patient
a) has the virus
b) does not have the virus?
If the test is negative what are theprobabilities that the patient
c) has the virusd) does not have the virus?
21
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
22/39
22
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
23/39
23
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
24/39
24
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
25/39
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
26/39
26
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
27/39
27
B i N t k
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
28/39
28
Bayesian Networks
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
29/39
29
Here H has two causes S and D. We need to know the probability of H
given each of the four possible combinations of S and D.
Lets suppose a medical survey gives us the following data.
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
30/39
30
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
31/39
Given the information we can now answer any
question concerning this network.
Suppose we want to know what the probability of
heart disease is: P(H)
In a Bayesian Network if we wish to know theprobability that nodeNis true, we have to look at
its parent nodes (i.e. its causes).
Listall possible combinationsof the values ofthe parent nodesand then consider the probability
thatNis true for each combination
31
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
32/39
In this problem we have to consider all the possible
combinations of the two parent nodes Sand D. There arefour ways he can have heart disease:
He smokes and has bad diet and he has heart disease
He does not smoke and has bad diet and has heartdisease
He smokes and does not have bad diet and has heart
disease
He does not smoke and does not have bad diet and has
heart disease
32
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
33/39
33
We have to work out the probabilities of all four situations and addthem together. Just as in the previous problem we use the SecondAxiom of Probability. For example the probability of each of these
cases is:
The values of all the quantities on the right-hand side are given
above. So we can work out the probabilities of all four cases. P(H) isjust the sum of all four.
P(H) = 0.80.30.4 + 0.50.70.4 + 0.40.30.6 + 0.10.70.6= 0.35
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
34/39
Suppose we wish to know the probability of heart disease andsmoking [ P(H S) ], i.e. you are told that a patient smokesand has heart disease but you do not know whether he hasbad diet or not. There are two ways in which a patient couldhave heart disease and smoke:
He smokes and has bad diet and he has heart disease He smokes and does not have bad diet and has heart
disease [see previous slide]
From this we can now work out the probability that a patienthas heart disease given that he smokes P(H| S). We use theSecond Axiom
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
35/39
35
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
36/39
36
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
37/39
37
Tentukan:1. P(H)2. P(HS)3. P(H\S)4. P(E\S)
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
38/39
38
-
7/31/2019 T02640010220114056Bayes Theorem & Bayes Nets_examples
39/39