Topics in Artificial Intelligence

advertisement
Topics in Artificial Intelligence
Modelling
uncertainty
Dr hab. inż. Joanna Józefowska, prof. PP
1/1
Probability of an event
Topics in Artificial Intelligence
• Classical method:
If an experiment has n possible outcomes assign a probability of
1/n to each experimental outcome.
• Relative frequency method:
Probability is the relative frequency of the number of events
satisfying the constraints.
• Subjective method:
Probability is a number characterising the likelihood of an event
– degree of belief
Dr hab. inż. Joanna Józefowska, prof. PP
1/2
Topics in Artificial Intelligence
Axioms of the probability theory
Axiom I
The probability value assigned to each
experimental outcome must be between 0 and 1.
Axiom II The sum of all the experimental outcome
probabilities must be 1.
Dr hab. inż. Joanna Józefowska, prof. PP
1/3
Topics in Artificial Intelligence
Conditional probability
denoted by P(A|B) expresses belief that event A is true
assuming that event B is true (events A and B are
dependent)
Definition
Let the probability of event B be positive. Conditional
probability of event A under condition B is calculated as
follows:
P(A,B)
P(A | B) 
,
P(B)
Dr hab. inż. Joanna Józefowska, prof. PP
whe re P(B)  0
1/4
Topics in Artificial Intelligence
Joint probability
If events A1, A2,... Are mutually exclusive and cover the
sample space , and P(Ai) > 0 for i = 1, 2,... then for any
event B the following equality holds:
P(B)   P(B | Ai )P(Ai )
i
Dr hab. inż. Joanna Józefowska, prof. PP
1/5
Topics in Artificial Intelligence
Bayes’ Theorem
Thomas Bayes (1701-1761)
If the events A1, A2,... fulfil the assumptions of the joint
probability theorem, and P(B) > 0, then for i =1, 2,... The
following equality holds:
P(Ai | B) 
P(B | Ai )P(Ai )
 P(B | Ai )P(Ai )
i
Dr hab. inż. Joanna Józefowska, prof. PP
1/6
Topics in Artificial Intelligence
Bayes’ Theorem
Prior
probabilities
New
information
Bayes’
theorem
Posterior
probabilities
Let us denote:
H – hipothesis
E – evidence
The Bayes’ rule has the form:
P(E | H)P(H)
P(H | E) 
P(E)
Dr hab. inż. Joanna Józefowska, prof. PP
1/7
Topics in Artificial Intelligence
Difficulties with joint probability distribution
(tabular approach)
• the joint probability distribution has to be
defined and stored in memory
• high computational effort required to calculate
marginal and conditional probabilities
Dr hab. inż. Joanna Józefowska, prof. PP
1/8
Topics in Artificial Intelligence
B
E
A
J
M
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
0
0
1
1
0
1
1
1
1
0
1
0
1
1
0
0
1
1
1
0
0
0
1
0
1
1
1
1
0
1
1
0
1
0
1
0
1
1
0
1
0
0
1
0
0
1
1
1
0
0
1
0
1
0
0
0
1
1
0
0
0
0
0
1
1
1
1
0
1
1
1
0
0
1
1
0
1
0
1
1
0
0
0
1
0
1
1
0
1
0
1
0
0
1
0
0
1
0
1
0
0
0
0
0
1
1
1
0
0
1
1
0
0
0
1
0
1
0
0
1
0
0
0
0
0
1
1
0
0
0
1
0
Dr hab. inż. Joanna Józefowska, prof. PP
0
0
0
0
1
P(B,E,A,J,M)
0,0001197000
0,0000133000
0,0000513000
0,0000057000
0,0000000050
0,0000000950
0,0000004950
0,0000094050
0,0058035600
0,0006448400
0,0024872400
0,0002763600
0,0000002940
0,0000055860
0,0000291060
0,0005530140
0,0036174600
0,0004019400
0,0015503400
0,0001722600
0,0000070290
0,0001335510
0,0006958710
0,0132215490
0,0006112260
0,0000679140
0,0002619540
0,0000291060
0,0004846149
0,0092076831
0,0479768751
n sample points
2n probabilities
P(B,M)
P(B,M)
P(B | M) 
P(M)
1/9
Topics in Artificial Intelligence
Certainty factor
• Buchanan, Shortliffe 1975
• Model developed for the rule expert system
MYCIN
If E then H
evidence
(observation)
Dr hab. inż. Joanna Józefowska, prof. PP
hipothesis
1/11
Topics in Artificial Intelligence
Belief
• MB[H, E] – measure of the increase of belief
that H is true based on observation E.
1


MB[H, E]  
max{P(H
|
E),
P(H)}

P(H)


max{1,0}  P(H)
Dr hab. inż. Joanna Józefowska, prof. PP
if P(H)  1
othewise
1/12
Topics in Artificial Intelligence
Disbelief
• MD[H, E] – measure of the increase of
disbelief that H is true based on observation
E.
1


MD[H, E]  
min{P(H
|
E),
P(H)}

P(H)


min{1,0}  P(H)
Dr hab. inż. Joanna Józefowska, prof. PP
if P(H)  0
otherwise
1/13
Topics in Artificial Intelligence
Certainty factor
CF(H,E)  MB[H, E]  MD[H, E]
CF  [–1, 1]
Dr hab. inż. Joanna Józefowska, prof. PP
1/14
Interpretation of the certainty factor
Topics in Artificial Intelligence
Certainty factor is associated with a rule:
If evidence then hipothesis
and denotes the change in belief that H is true after
observation E.
E
CF(H, E)
Dr hab. inż. Joanna Józefowska, prof. PP
H
1/15
Uncertainty propagation
E1
CF(H, E1)
Topics in Artificial Intelligence
H
E2
E1, E2
CF(H, E1&E2)
H
CF(H, E2)
Parallel rules
0

MB(H, E1 & E2 )  

MB(H, E1)  MB(H, E2 ) * [1- MB(H, E1 )]
if MD(H, E1 & E2 )  1
0

MD(H, E1 & E2 )  

MD(H, E1)  MD(H, E2 ) * [1- MD(H, E1 )]
if MB(H, E1 & E2 )  1
Dr hab. inż. Joanna Józefowska, prof. PP
otherwise
otherwise
1/16
Uncertainty propagation
Topics in Artificial Intelligence
E1
CF(E2, E1)
E2
CF(H, E2)
H
E1
CF(H, E1)
H
Serial rules
CF(E2,E1)CF(H,E2 )
CF(H,E1)  
CF(E2,E1)CF(H, E2 )
if CF(E2,E1)  0
otherwise
If CF(H,E2) is not defined, it is assumed to be 0.
Dr hab. inż. Joanna Józefowska, prof. PP
1/17
Certainty factor – probabilistic definition
Topics in Artificial Intelligence
Heckerman 1986
 P(H | E)  P(H) gdy P(H | E)  P(H)
 P(H | E)(1  P(H))

CF(H,E)  
 P(H | E)  P(H)
 P(H)(1 P(H | E)) gdy P(H)  P(H | E)
Dr hab. inż. Joanna Józefowska, prof. PP
1/18
Certainty measure
Grzymała-Busse 1991
C(H)
Topics in Artificial Intelligence
C(E)
E
CF(H, E)
C(H)  (1  C(H))CF' (E  H)
C(H)  (1  C(H))CF' (E  H)

C' (H)  

C(H)  CF'(E  H)

1 min{| C(H) |,| CF'(E  H) |}
H
if C(H), CF'(E  H)  0
if C(H), CF'(E  H)  0
if C(H)CF' (E  H)  0
CF' (E  H)  CF(E  H)  max{0,C(E)}
Dr hab. inż. Joanna Józefowska, prof. PP
1/19
Example 1
C(s1) = 0,2
s1
CF(h, s1  s2) = 0,4
h
s2
C(h) = 0,3
Topics in Artificial Intelligence
C(s2) = – 0,1
C(s1  s2) = min(0,2; – 0,1) = – 0,1
CF’(h, s1  s2) = 0,4 * 0 = 0
C’(h) = 0,3 + (1– 0,3) * 0 = 0,3 + 0 = 0,3
CF' (E  H)  CF(E  H)  max{0,C(E)}
C' (H)  C(H)  (1 C(H))CF' (E  H)
Dr hab. inż. Joanna Józefowska, prof. PP
if C(H), CF'(E  H)  0
1/20
Example 2
C(s1) = 0,2
s1
CF(h, s1  s2) = 0,4
h
s2
C(h) = 0,3
Topics in Artificial Intelligence
C(s2) = 0,8
C(s1  s2) = min(0,2; 0,8) = 0,2
CF’(h, s1  s2) = 0,4 * 0,2 = 0,08
C’(h) = 0,3 + (1– 0,3) * 0,08 = 0,3 + 0,7 * 0,08 = 0,356
CF' (E  H)  CF(E  H)  max{0,C(E)}
C' (H)  C(H)  (1 C(H))CF' (E  H)
Dr hab. inż. Joanna Józefowska, prof. PP
if C(H), CF'(E  H)  0
1/21
Topics in Artificial Intelligence
Dempster-Shafer theory
Each hipothesis is characterised by two values: balief and
plausibility.
It models not only belief, but also the amount of acquired
information.
Dr hab. inż. Joanna Józefowska, prof. PP
1/22
Topics in Artificial Intelligence
Density probability function
Θ
m:2
 0,1
m[]  0
 m(A)  1
A Θ
Dr hab. inż. Joanna Józefowska, prof. PP
1/23
Topics in Artificial Intelligence
Belief
Belief
Bel  [0,1] measures the value of acquired
information supporting the belief that the considered set
hipothesis is true.
Bel(A) 
 m(B)
B A
Dr hab. inż. Joanna Józefowska, prof. PP
1/24
Topics in Artificial Intelligence
Plausibility
Plausibility Pl  [0,1] measures how much the belief that A
is true is limited by evidence supporting A.
Pl(A)  1  Bel(A)
Dr hab. inż. Joanna Józefowska, prof. PP
1/25
Topics in Artificial Intelligence
Combining various sources of evidence
Assume two sources of evidence: X and Y represented by
respective subsets of : X1,...,Xm and Y1,...,Yn. Probability
density functions m1 and m2 are defined on X and Y
respectively. Combining observations from two sources a
new value m3(Z) is calculated for each subset of  as
follows:
 m1(Xi )m2 (Yj )
m3 (Z) 
Xi  Yj  Z
1
 m1(Xi )m2 (Yj )
Xi  Yj 
Dr hab. inż. Joanna Józefowska, prof. PP
1/26
A – allergy
F – flu
C – cold
P - pneumonia
Example
Topics in Artificial Intelligence
 ={A, F, C, P}
Observation 1
m1() = 1
m2({A, F, C}) = 0,6
m2() = 0,4
m2({A, F, C}) = 0,6 m2() = 0,4
m1() = 1
m3({A, F, C}) = 0,6 m3() = 0,4
Dr hab. inż. Joanna Józefowska, prof. PP
1/27
Example
Topics in Artificial Intelligence
m3({A, F, C}) = 0,6 m3() = 0,4
Observation 2
m4({F,C,P}) = 0,8
m4() = 0,2
m4({F,C,P}) = 0,8
m4() = 0,2
m3({A,F,C}) = 0,6
m5({F,C}) = 0,48
m5({A,F,C}) = 0,12
m3() = 0,4
m5({F,C,P}) = 0,32 m5() = 0,08
Dr hab. inż. Joanna Józefowska, prof. PP
1/28
Example
m5({F,C}) = 0,48
m5({A,F,C}) = 0,12
Topics in Artificial Intelligence
m5({F,C,P}) = 0,32 m5() = 0,08
Observation 3
m6({A}) = 0,75
m6() = 0,25
m7({A}) = 0,15
m6({A}) = 0,75
m6() = 0,25
m5({F,C}) = 0,48
m7() = 0,36
m7({F,C}) = 0,12
m5({A,F,C}) = 0,12
m7({A}) = 0,09
m7({A,F,C}) = 0,03
m5({F,C,P}) = 0,32
m7() = 0,24
m7({F,C,P}) = 0,08
m5() = 0,08
m7({A}) = 0,06
m7() = 0,02
Dr hab. inż. Joanna Józefowska, prof. PP
1/29
Example
m5({F,C}) = 0,48
m5({A,F,C}) = 0,12
Topics in Artificial Intelligence
m5({F,C,P}) = 0,32 m5() = 0,08
Observation 3
m6({A}) = 0,75
m6() = 0,25
m7() = 0,6
m6({A}) = 0,75
m6() = 0,25
m5({F,C}) = 0,48
m7() = 0,36
m7({F,C}) = 0,12
m5({A,F,C}) = 0,12
m7({A}) = 0,09
m7({A,F,C}) = 0,03
m5({F,C,P}) = 0,32
m7() = 0,24
m7({F,C,P}) = 0,08
m5() = 0,08
m7({A}) = 0,06
m7() = 0,02
Dr hab. inż. Joanna Józefowska, prof. PP
1/30
Topics in Artificial Intelligence
Example
m7({A}) = 0,15
m7({A}) = 0,375
m7({F,C}) = 0,12
m7({F,C}) = 0,3
m7({A,F,C}) = 0,03
m7({A,F,C}) = 0,075
m7({F,C,P}) = 0,08
m7({F,C,P}) = 0,2
m7() = 0,02
m7() = 0,05
1 – 0,3 – 0,2
{A}: [0,375, 0,500]
{F}: [0, 0,625]
{C}: [0, 0,625]
1 – 0,375
{P}: [0, 0,250]
Dr hab. inż. Joanna Józefowska, prof. PP
1/31
1 – 0,375 – 0,3 – 0,075
Topics in Artificial Intelligence
Fuzzy sets (Zadeh)
Rough sets (Pawlak)
Dr hab. inż. Joanna Józefowska, prof. PP
1/32
Topics in Artificial Intelligence
Probabilistic reasoning
earthquake
burglary
alarm
John
Dr hab. inż. Joanna Józefowska, prof. PP
Mary
1/33
Probabilistic reasoning
Topics in Artificial Intelligence
B – burglary
E – earthquake
?
A – alarm
J – John calls
M – Mary calls
Joint probability distribution – P(B,E,A,J,M)
Dr hab. inż. Joanna Józefowska, prof. PP
1/34
Topics in Artificial Intelligence
B
E
A
J
M
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
0
0
1
1
0
1
1
1
1
0
1
0
1
1
0
0
1
1
1
0
0
0
1
0
1
1
1
1
0
1
1
0
1
0
1
0
1
1
0
1
0
0
1
0
0
1
1
1
0
0
1
0
1
0
0
0
1
1
0
0
0
0
0
1
1
1
1
0
1
1
1
0
0
1
1
0
1
0
1
1
0
0
0
1
0
1
1
0
1
0
1
0
0
1
0
0
1
0
1
0
0
0
0
0
1
1
1
0
0
1
1
0
0
0
1
0
1
0
0
1
0
0
0
0
0
1
1
0
0
0
1
0
Dr hab. inż. Joanna Józefowska, prof. PP
0
0
0
0
1
P(B,E,A,J,M)
0,0001197000
0,0000133000
0,0000513000
0,0000057000
0,0000000050
0,0000000950
0,0000004950
0,0000094050
0,0058035600
0,0006448400
0,0024872400
0,0002763600
0,0000002940
0,0000055860
0,0000291060
0,0005530140
0,0036174600
0,0004019400
0,0015503400
0,0001722600
0,0000070290
0,0001335510
0,0006958710
0,0132215490
0,0006112260
0,0000679140
0,0002619540
0,0000291060
0,0004846149
0,0092076831
0,0479768751
Joint probability
distribution
1/35
Probabilistic reasoning
Topics in Artificial Intelligence
What is the probability of a burglary if Mary called?
P(B=y|M=y) ?
Marginal probability:
P(B,M) 
P(B,E, A, J,M)
E,A,J
B
1
1
0
0
M
1
0
1
0
P(B,E,A,J,M)
0,0084917
0,0015083
0,05520537
0,93479463
Conditional probability:
P(M, B)
0.0084917
P(B | M) 

 0.133313
P(M)
0.0084917  0.05520537
Dr hab. inż. Joanna Józefowska, prof. PP
1/36
Topics in Artificial Intelligence
Advantages of probabilistic reasoning
• Sound mathematical theory
• On the basis of the joint probability distribution one can
reason about:
– the reasons on the basis of the observed
consequences,
– consequences on the basis of given evidence,
– Any combination of the above ones.
• Clear semantics based on the interpretation of
probability.
• Model can be taught with statistical data.
Dr hab. inż. Joanna Józefowska, prof. PP
1/37
Complexity of probabilistic reasoning
Topics in Artificial Intelligence
• in the „alarm” example
– (25 – 1) = 31 values,
– direct acces to unimportant information, e.g.
P(B=1,E=1,A=1,J=1,M=1)
– calculating any practical value, e.g. P(B=1|M=1)
requires 29 elementary operations.
• in general
– P(X1, ..., Xn) requires storing 2n-1 values
– difficult knowledge acquisition (not natural)
– exponential complexity
Dr hab. inż. Joanna Józefowska, prof. PP
1/38
Topics in Artificial Intelligence
Bayes’ theorem
P(E | H)P(H)
P(H | E) 
P(E)
Dr hab. inż. Joanna Józefowska, prof. PP
1/39
Topics in Artificial Intelligence
Bayes’ theorem
B depends on A
A
B
P(B|A)
P(B)   P(B | A)P(A)
A
P(B | A)P(A)
P(A | B) 
P(B)
Dr hab. inż. Joanna Józefowska, prof. PP
1/40
Topics in Artificial Intelligence
The chain rule
P(X1,X2) = P(X1)P(X2|X1)
P(X1,X2,X3) = P(X1)P(X2|X1)P(X3|X1,X2)
................................................................
P(X1,X2,...,Xn) = P(X1)P(X2|X1)...P(Xn|X1,...,Xn-1)
Dr hab. inż. Joanna Józefowska, prof. PP
1/41
Topics in Artificial Intelligence
Conditional independence of variables in a
domain
In any domain one can define a set of variables
pa(Xi){X1, ..., Xi–1} such that Xi is independent of
variables from the set {X1, ..., Xi–1} \ pa(Xi).
Thus
P(Xi|X1, ..., Xi – 1) = P(Xi|pa(Xi))
and
n
P(X1, ..., Xn) =  P(Xi|pa(Xi))
i=1
Dr hab. inż. Joanna Józefowska, prof. PP
1/42
Bayesian network
Topics in Artificial Intelligence
B1
B2
.....
A
Bn
P(A|B1, ..., Bn)
Bi directly
influences A
C1
.....
Dr hab. inż. Joanna Józefowska, prof. PP
Cm
1/43
Example
earthquake
burglary
Topics in Artificial Intelligence
alarm
John calls
burglary
true
true
false
false
earthquake
true
false
true
false
Dr hab. inż. Joanna Józefowska, prof. PP
Mary calls
P(alarm|burglary,
earthquake)
true
false
0.950
0.050
0.940
0.060
0.290
0.710
0.001
0.999
1/44
Topics in Artificial Intelligence
Example
P(B)
P(E)
0.001
0.002
E
B
A
J
B
E
P(A)
T
T
F
F
T
F
T
F
0.950
0.940
0.290
0.001
M
A
P(J)
A
P(M)
T
F
0.90
0.05
T
F
0.70
0.01
Dr hab. inż. Joanna Józefowska, prof. PP
1/45
Topics in Artificial Intelligence
Complexity of the representation
• Instead of 31 values it is enough to store
10.
• Easy construction of the model
– Less parameters.
– More intuitive parameters.
• Easy reasoning.
Dr hab. inż. Joanna Józefowska, prof. PP
1/46
Bayesian networks
Topics in Artificial Intelligence
Bayesian network is an acyclic directed graph which
• nodes represent formulas
considered domain,
or
variables
in
the
• arcs represent dependence relation of variables, with
related probability distributions.
Dr hab. inż. Joanna Józefowska, prof. PP
1/47
Bayesian networks
Topics in Artificial Intelligence
variable A with parent nodes pa(A) = {B1,...,Bn}
conditional probablity table P(A|B1,...,Bn) or P(A|pa(A))
if pa(A) =  a priori probability equals P(A)
Dr hab. inż. Joanna Józefowska, prof. PP
1/48
pa(A)
Bayesian networks
Topics in Artificial Intelligence
B1
B2
B3
A
Event Bi has no predecesors
(pa(Bi) = ) a priori
probability P(Bi)
Dr hab. inż. Joanna Józefowska, prof. PP
.....
Bn
P(A|B1, B2, ..., Bn)
B1 ... Bn
P(A|B1, Bn)
T
T
0.18
T
F
0.12
.................................
F
F
0.28
1/49
Topics in Artificial Intelligence
Local semantics of Bayesian network
• Only direct dependence relations between variables.
• Local conditional probability distribution.
• Assumption about conditional independence
variables not bounded in the graph.
Dr hab. inż. Joanna Józefowska, prof. PP
of
1/50
Global semantics of bayesian network
Topics in Artificial Intelligence
Joint probability distribution given implicite.
It can be calculated using the following rule:
P(A1,..., An )   P(Ai | Ai1,..., An )
i
 P(A1 | A2, A3,..., An )...P(A n-1 | An )P(An )
Dr hab. inż. Joanna Józefowska, prof. PP
1/51
Topics in Artificial Intelligence
Global semantics of bayesian network
Node numbering: node index is smaller than indices of its
predecessors.
P(Ai | Ai1,..., An )  P(Ai | pa(Ai ))
Finally:
P(A1,..., An )   P(Ai | pa(Ai ))
i
Bayesian network is a complete probabilistic model.
Dr hab. inż. Joanna Józefowska, prof. PP
1/52
Global probability distribution
pa(A2)
Topics in Artificial Intelligence
pa(A1)
B1
B2
B3
A1
P(A1|B1, ...Bn)
Dr hab. inż. Joanna Józefowska, prof. PP
.....
Bn
A2
B1 ... Bn A1 A2 P(A1,A2,B1, ...Bn)
T ... T T T
P(A2|B3,
T ... T T F
...Bn)
......................................................
1/53
F ... F F F
Global probability distribution
pa(A2)
Topics in Artificial Intelligence
pa(A1)
B1
B1 ... Bn A1 A2 P(A1,A2,B1, ...Bn)
B2
B3
.....
T ... T T T
0.075
T ...BnT T F
......................................................
F ... F F F
P(A1|B1, ...Bn)
B1 ... B
Bn1 P(A1)
T ... T
0.25
T ... F
..........................
F ... F
P(A2|B3, ...Bn)
B3 ... B
Bn1 P(A2)
A1
Dr hab. inż. Joanna Józefowska, prof. PP
A2
T ... T
0.30
T ... F
..........................
F ... F
1/54
Topics in Artificial Intelligence
Reasoning in Bayesian networks
Updating evidence that a hipothesis H is true given some
ecidence E, i.e. defining conditional probability distribution
P(H|E).
Two types of reasoning:
• probability of a single hipothesis
• probability of all hipothesis.
Dr hab. inż. Joanna Józefowska, prof. PP
1/55
Topics in Artificial Intelligence
Example
P(B)
P(E)
0.001
0.002
E
B
John calls (J) and Mary
calls (M). What is the
probability that neither
burglary nor earthquake
occurred if the alarm
rang?
J
A
B
E
P(A)
T
T
F
F
T
F
T
F
0.950
0.940
0.290
0.001
M
A
P(J)
A
P(M)
T
F
0.90
0.05
T
F
0.70
0.01
Dr hab. inż. Joanna Józefowska, prof. PP
1/56
Example
Topics in Artificial Intelligence
P(J  M  A  B  E)  ?
P(B)
P(E)
0.001
0.002
B
E
P(A)
T
T
F
F
T
F
T
F
0.950
0.940
0.290
0.001
P(A1,..., An )   P(Ai | pa(Ai ))
i
E
B
A
M
J
A
P(J)
A
P(M)
T
F
0.90
0.05
T
F
0.70
0.01
P(J  M  A  B  E)
1/57
 P(J
| inż.A)P(M
| A)P(A
| B  E)P( B)P( E)
Dr hab.
Joanna Józefowska,
prof. PP
Example
Topics in Artificial Intelligence
P(J  M  A  B  E)  ?
P(B)
P(E)
0.001
0.002
E
B
B
E
P(A)
T
T
F
F
T
F
T
F
0.950
0.940
0.290
0.001
A
M
J
A
P(J)
A
P(M)
T
F
0.90
0.05
T
F
0.70
0.01
P(J  M  A  B  E)
 P(J | A)P(M | A)P(A | B  E)P( B)P( E)
Dr hab. inż. Joanna Józefowska, prof. PP
1/58
Example
Topics in Artificial Intelligence
P(J  M  A  B  E)  ?
P(B)
P(E)
0.001
0.002
E
B
B
E
P(A)
T
T
F
F
T
F
T
F
0.950
0.940
0.290
0.001
A
M
J
A
P(J)
A
P(M)
T
F
0.90
0.05
T
F
0.70
0.01
P(J  M  A  B  E)
 P(J | A)P(M | A)P(A | B  E)P( B)P( E)
Dr hab. inż. Joanna Józefowska, prof. PP
1/59
Example
Topics in Artificial Intelligence
P(J  M  A  B  E)  ?
P(B)
P(E)
0.001
0.002
E
B
B
E
P(A)
T
T
F
F
T
F
T
F
0.950
0.940
0.290
0.001
A
M
J
A
P(J)
A
P(M)
T
F
0.90
0.05
T
F
0.70
0.01
P(J  M  A  B  E)
 P(J | A)P(M | A)P(A | B  E)P( B)P( E)
Dr hab. inż. Joanna Józefowska, prof. PP
1/60
Example
Topics in Artificial Intelligence
P(J  M  A  B  E)  ?
P(B)
P(E)
0.001
0.002
E
B
B
E
P(A)
T
T
F
F
T
F
T
F
0.950
0.940
0.290
0.001
A
M
J
A
P(J)
A
P(M)
T
F
0.90
0.05
T
F
0.70
0.01
P(J  M  A  B  E)
 P(J | A)P(M | A)P(A | B  E)P( B)P( E)
Dr hab. inż. Joanna Józefowska, prof. PP
1/61
Example
Topics in Artificial Intelligence
P(J  M  A  B  E)  ?
P(B)
P(E)
0.001
0.002
E
B
B
E
P(A)
T
T
F
F
T
F
T
F
0.950
0.940
0.290
0.001
A
M
J
A
P(J)
A
P(M)
T
F
0.90
0.05
T
F
0.70
0.01
P(J  M  A  B  E)
 P(J | A)P(M | A)P(A | B  E)P( B)P( E)
Dr hab. inż. Joanna Józefowska, prof. PP
1/62
Example
Topics in Artificial Intelligence
P(J  M  A  B  E)  ?
P(B)
P(E)
0.001
0.002
E
B
B
E
P(A)
T
T
F
F
T
F
T
F
0.950
0.940
0.290
0.001
A
M
J
A
P(J)
A
P(M)
T
F
0.90
0.05
T
F
0.70
0.01
P(J  M  A  B  E)
 P(J | A)P(M | A)P(A | B  E)P( B)P( E)
 Dr
0.9
* 0.7
0.001prof.* PP
0.999 * 0.998  0.00062
hab. inż.
Joanna*
Józefowska,
1/63
Types of reasoning in Bayesian networks
Topics in Artificial Intelligence
P(B) = 0.001
B
Evidence B occurs and we qould like to
update probability of hipothesis J.
Interpretation.
B P(A)
A
T 0.95
F 0.01
There was a burglary, what is the
probability that John will call?
J
A P(J)
T 0.90
F 0.05
P(J|B) = P(J|A)P(A|B) = 0.9 * 0.95 = 0.86
Dr hab. inż. Joanna Józefowska, prof. PP
1/64
Types of reasoning in Bayesian networks
Topics in Artificial Intelligence
P(B) = 0.001
B P(A)
B
We observe J – what is the probability
that B is true?
A
T 0.95
F 0.01
A P(J)
Wnioskowanie diagnostyczne
Diagnosis.
John calls. What is the probability of a
burglary?
J
T 0.90
F 0.05
P(B|J) = P(J|B)*P(B)/P(J) =
diagnostic
(0,95*0,9*0,001)/(0,9+0,05) = 0,0009
Dr hab. inż. Joanna Józefowska, prof. PP
1/65
Types of reasoning in Bayesian networks
Topics in Artificial Intelligence
We observe E. What is the probability
that B is true?
B
E
A
Alarm rang, so P(B|A) = 0.376, but if
earthuake is observed as well then
P(B|A,E) = 0.03
Dr hab. inż. Joanna Józefowska, prof. PP
1/66
Topics in Artificial Intelligence
Types of reasoning in Bayesian networks
E
We observe E and J What is the probability
of A.
A
John calls and we know that there was an
earthquake. What is the probability that
alarm rang?
J
P(A|J,E) = 0.03
mixed
Dr hab. inż. Joanna Józefowska, prof. PP
1/67
Multiply connected Bayesian network
B2
Topics in Artificial Intelligence
B1
A1
.....
...
A2
C1
.....
Dr hab. inż. Joanna Józefowska, prof. PP
Bn
Ak
Cm
1/69
Topics in Artificial Intelligence
Summary
• Models of uncertainty:
• Certainty factor, certainty measure
• Dempster-Shafer theory
• Bayesian networks
• Fuzzy sets
• Raough sets
Dr hab. inż. Joanna Józefowska, prof. PP
1/70
Topics in Artificial Intelligence
Summary
• Bayesian
networks
distribution.
represent
joint
probability
• Reasoning in multiply connected BN is NP-hard.
• Exponential complexity may be avoided by:
• Constructing the net as a polytree
• Transforming a network to a polytree
• Approximate reasoning
Dr hab. inż. Joanna Józefowska, prof. PP
1/71
Download