Download Bayesian Networks

Document related concepts
no text concepts found
Transcript
Mainly based on F. V. Jensen, „Bayesian Networks and Decision Graphs“, Springer-Verlag New York, 2001.
Advanced
I
WS 06/07
MINVOLSET
KINKEDTUBE
PULMEMBOLUS INTUBATION
PAP
SHUNT
VENTMACH
VENTLUNG
DISCONNECT
VENITUBE
PRESS
MINOVL
ANAPHYLAXIS
SAO2
TPR
HYPOVOLEMIA
LVEDVOLUME
CVP
LVFAILURE
FIO2
VENTALV
PVSAT
ARTCO2
INSUFFANESTH
CATECHOL
STROEVOLUME HISTORY ERRBLOWOUTPUT
PCWP
Graphical Models
- Modeling -
EXPCO2
CO
HR
HREKG
ERRCAUTER
HRSAT
HRBP
BP
Wolfram Burgard, Luc De Raedt, Kristian Kersting, Bernhard Nebel
Albert-Ludwigs University Freiburg, Germany
Outline
• Introduction
• Reminder: Probability theory
• Basics of Bayesian Networks
• Modeling Bayesian networks
• Inference
• Excourse: Markov Networks
• Learning Bayesian networks
• Relational Models
Bayesian Networks
Advanced
I
WS 06/07
Advanced
I
WS 06/07
(Discrete) Random Variables and Probability
The sample space S of a random variable is the set
of all possible values of the variable: Ace, King,
Queen, Jack, …
An event is a subset of S: {Ass, King}, {Queen}, …
The probability function P(X=x), short P(x),defines
the probability that X yields a certain value x.
Bayesian Networks - Reminder: Probability Theory
A random variable X describes a value that is the
result of a process which can not be determined in
advance: the rank of the card we draw from a deck
Advanced
I
WS 06/07
(Discrete) Random Variables and Probability
States are mutually exclusive
A probability space has the following properties:
Bayesian Networks - Reminder: Probability Theory
The world  is described as a set of random variables and
divided it into elementary events or states
Advanced
I
WS 06/07
Conditional probability and Bayes’ Rule
P(x|y) denotes the conditional probability that x will
happen given that y has happened.
Bayes’ rule states that:
Bayesian Networks - Reminder: Probability Theory
If it is known that a certain event occurred this may
change the probability that another event will occur
Advanced
I
WS 06/07
Fundamental rule
Bayesian Networks - Reminder: Probability Theory
• The fundamental rule (sometimes called ‚chain rule‘)
for probability calculus is
Advanced
I
WS 06/07
Conditional probability and Bayes’ Rule
Note:
mirrors our intuition that the unconditional probability of an
event is somewhere between its conditional probability
based on two opposing assumptions.
Bayesian Networks - Reminder: Probability Theory
The complete probability formula states that
Joint Probability Distribution
• „truth table“ of set
of random variables
X1
X2
X3
true
1
green
0.001
true
1
blue
0.021
true
2
green
0.134
true
2
blue
0.042
...
...
...
...
false
2
blue
0.2
• Any probability we are interested in can be
computed from it
Bayesian Networks - Reminder: Probability Theory
Advanced
I
WS 06/07
Advanced
I
WS 06/07
Bayes´rule and Inference
posterior
probability
likelihood
prior
probability
This allows us to update our belief in a hypothesis
based on prior belief and in response to evidence.
Bayesian Networks - Reminder: Probability Theory
Bayes’ is fundamental in learning when viewed in
terms of evidence and hypothesis:
Independence among random variables
Two random variables X and Y are independent if
knowledge about X does not change the
uncertainty about Y and vice versa.
Formally for a probability distribution P:
Bayesian Networks - Reminder: Probability Theory
Advanced
I
WS 06/07
Independence among random variables
Bayesian Networks - Reminder: Probability Theory
Advanced
I
WS 06/07
Outline
• Introduction
• Reminder: Probability theory
• Basics of Bayesian Networks
• Modeling Bayesian networks
• Inference
• Excourse: Markov Networks
• Learning Bayesian networks
• Relational Models
Bayesian Networks
Advanced
I
WS 06/07
Bayesian Networks
E
B
1. Finite, acyclic graph
A
2. Nodes: (discrete) random variables
J
M
3. Edges: direct influences
4. Associated with each node: a table
representing a conditional probability
distribution (CPD), quantifying the effect the
parents have on the node
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Associated CPDs
• naive representation
–tables
• other representations
E
–decision trees
e
e
–rules
e
–neural networks
e
–support vector machines
– ...
B
E
A
B P(A | E,B)
b .9
.1
b .7
.3
b .8
.2
b .99 .01
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Bayesian Networks
Advanced
I
WS 06/07
X2
X1
(0.6, 0.4)
(0.2, 0.8)
true
1
(0.2,0.8)
true
2
(0.5,0.5)
false
1
(0.23,0.77)
false
2
(0.53,0.47)
Bayesian Networks - Bayesian Networks
X3
Conditional Independence I
Each node / random variable is
(conditionally) independent of all its nondescendants given a joint state of its
parents.
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Example
Advanced
I
WS 06/07
Visit to Asia?
Has tuberculosis
Has lung cancer
Has bronchitis
Tuberculosis or cancer
Positive X-ray?
Dyspnoea?
Bayesian Networks - Bayesian Networks
Smoker?
Example
Advanced
I
WS 06/07
Visit to Asia?
Has lung cancer
Has bronchitis
Tuberculosis or cancer
Positive X-ray?
Dyspnoea?
Bayesian Networks - Bayesian Networks
Has tuberculosis
Smoker?
Example
Advanced
I
WS 06/07
Visit to Asia?
Has lung cancer
Has bronchitis
Tuberculosis or cancer
Positive X-ray?
Dyspnoea?
Bayesian Networks - Bayesian Networks
Has tuberculosis
Smoker?
Example
Advanced
I
WS 06/07
Visit to Asia?
Has tuberculosis
Has lung cancer
Has bronchitis
Tuberculosis or cancer
Positive X-ray?
Dyspnoea?
Bayesian Networks - Bayesian Networks
Smoker?
Summary Semantics
Advanced
I
WS 06/07
B
T
Compact & natural representation:
nodes have  k parents
 2k n instead of 2n params
Bayesian Networks - Bayesian Networks
conditional
local
full joint
independencies + probability = distribution
I
models
over domain
in
BN
structure
X
S
Advanced
I
WS 06/07
Operations
• Inference:
• Most probable explanation:
E
• Data Conflict (coherence of evidence)
– positive conf(e) indicates
a possible conflict
• Sensitivity analysis
– Which evidence is in favour of/against/irrelevant for H
– Which evidence discriminates H from H´
Bayesian Networks - Bayesian Networks
– Most probable configuration of
given the evidence
Advanced
I
WS 06/07
Conditional Independence II
• One could graphically read off other conditional
independencies based on
A
B
– Diverging connections
A
B
– Converging connections
B
C
C
A
...
C
E
...
E
Bayesian Networks - Bayesian Networks
– Serial connections
Serial Connections - Example
Initial
opponent´s hand
Opponent´s hand
after the first
change of cards
Final
opponent´s hand
• Poker: If we do not know the opponent´s
hand after the first change of cards,
knowing her initial hand will tell us more
about her final hand.
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Serial Connections - Example
Advanced
I
WS 06/07
Initial
opponent´s hand
pair
Opponent´s hand
after the first
change of cards
pair
Final
opponent´s hand
• Poker: If we do not know the opponent´s
hand after the first change of cards,
knowing her initial hand will tell us more
about her final hand.
Bayesian Networks - Bayesian Networks
pair
Serial Connections - Example
Initial
opponent´s hand
Opponent´s hand
after the first
change of cards
Final
opponent´s hand
• If we know the opponent´s hand after the
first change of cards, knowing her initial
hand will tell us nothing about her final
hand.
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Serial Connections - Example
Initial
opponent´s hand
pair
pair
Opponent´s hand
after the first
change of cards
Final
opponent´s hand
flush
• If we know the opponent´s hand after the
first change of cards, knowing her initial
hand will tell us nothing about her final
hand.
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Serial Connections
Advanced
I
WS 06/07
A
B
C
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
Serial Connections
Advanced
I
WS 06/07
A
B
C
a
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
Serial Connections
Advanced
I
WS 06/07
A
a
B
C
a
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
Serial Connections
Advanced
I
WS 06/07
A
B
C
b
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
Serial Connections
Advanced
I
WS 06/07
A
B
b
b
C
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
Serial Connections
Advanced
I
WS 06/07
A
B
C
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
• Evidence on A will influence the certainty of C
(through B) and vice versa
Serial Connections
Advanced
I
WS 06/07
A
B
C
a
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
• Evidence on A will influence the certainty of C
(through B) and vice versa
Serial Connections
Advanced
I
WS 06/07
A
a
B
C
a
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
• Evidence on A will influence the certainty of C
(through B) and vice versa
Serial Connections
Advanced
I
WS 06/07
A
a
B
a
C
a
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
• Evidence on A will influence the certainty of C
(through B) and vice versa
Serial Connections
Advanced
I
WS 06/07
A
B
C
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
• Evidence on A will influence the certainty of C
(through B) and vice versa
• IF the state of B is known, THEN the channel
through B is blocked, A and B become
independent
Serial Connections
Advanced
I
WS 06/07
A
B
C
b
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
• Evidence on A will influence the certainty of C
(through B) and vice versa
• IF the state of B is known, THEN the channel
through B is blocked, A and B become
independent
Serial Connections
Advanced
I
WS 06/07
A
a
a
B
C
b
Bayesian Networks - Bayesian Networks
• A has influence on B, and B has influence on C
• Evidence on A will influence the certainty of C
(through B) and vice versa
• IF the state of B is known, THEN the channel
through B is blocked, A and B become
independent
Advanced
I
WS 06/07
Conditional Independence II
• One could graphically read off other conditional
independencies based on
A
B
– Diverging connections
A
B
– Converging connections
B
C
A
C
...
C
E
...
E
Bayesian Networks - Bayesian Networks
– Serial connections
Advanced
I
WS 06/07
Diverging Connections - Example
Sex
Stature
• If we do not know the sex of a person,
seeing the length of her hair will tell us
more about the sex, and this in turn will
focus our belief on her stature.
Bayesian Networks - Bayesian Networks
Hair length
Diverging Connections - Example
Advanced
I
WS 06/07
Sex
Hair length
long
Stature
long
• If we do not know the sex of a person,
seeing the length of her hair will tell us
more about the sex, and this in turn will
focus our belief on her stature.
Bayesian Networks - Bayesian Networks
long
Advanced
I
WS 06/07
Diverging Connections - Example
Sex
Stature
• If we know that the person is a man, then
the length of hair gives us no extra clue
on his stature.
Bayesian Networks - Bayesian Networks
Hair length
Advanced
I
WS 06/07
Diverging Connections - Example
male
Sex
long
Stature
long
• If we know that the person is a man, then
the length of hair gives us no extra clue
on his stature.
Bayesian Networks - Bayesian Networks
Hair length
Diverging Connections
Advanced
I
WS 06/07
A
C
...
E
• Influence can pass between all the children
of A unless the state of A is known
Bayesian Networks - Bayesian Networks
B
Diverging Connections
Advanced
I
WS 06/07
A
C
...
E
b
• Influence can pass between all the children
of A unless the state of A is known
Bayesian Networks - Bayesian Networks
B
Diverging Connections
Advanced
I
WS 06/07
A
b
C
...
E
b
• Influence can pass between all the children
of A unless the state of A is known
Bayesian Networks - Bayesian Networks
B
Diverging Connections
Advanced
I
WS 06/07
A
b
B
C
...
E
b
• Influence can pass between all the children
of A unless the state of A is known
Bayesian Networks - Bayesian Networks
b
Diverging Connections
Advanced
I
WS 06/07
A
B
b
C
...
E
b
• Influence can pass between all the children
of A unless the state of A is known
Bayesian Networks - Bayesian Networks
b
Diverging Connections
Advanced
I
WS 06/07
B
A
C
...
E
• Influence can pass between all the children
of A unless the state of A is known
Bayesian Networks - Bayesian Networks
a
Diverging Connections
Advanced
I
WS 06/07
B
A
C
...
E
b
• Influence can pass between all the children
of A unless the state of A is known
Bayesian Networks - Bayesian Networks
a
Diverging Connections
Advanced
I
WS 06/07
a
A
b
C
...
E
b
• Influence can pass between all the children
of A unless the state of A is known
Bayesian Networks - Bayesian Networks
B
Advanced
I
WS 06/07
Conditional Independence II
• One could graphically read off other conditional
independencies based on
A
B
– Diverging connections
A
B
– Converging connections
B
C
C
A
...
C
E
...
E
Bayesian Networks - Bayesian Networks
– Serial connections
Converging Connections - Example
Flue
Salmonella
• If we know nothing of
nausea or pallor, then the
information on whether
the person has a
Salmonella infection will
tell us anything about
flu.
Nausea
Pallor
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Advanced
I
WS 06/07
Converging Connections - Example
Flue
Salmonella
yes
• If we know nothing of
nausea or pallor, then the
information on whether
the person has a
Salmonella infection will
tell us anything about
flu.
Nausea
Pallor
yes
Bayesian Networks - Bayesian Networks
yes
Converging Connections - Example
Flu
Salmonella
• If we have noticed the
person is pale, then the
information that the she
does not have a Salmonella
infection will make us
more ready to believe
that she has the flu.
Nausea
Pallor
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Converging Connections - Example
yes
Flu
Salmonella
• If we have noticed the yes
person is pale, then the
information that the she
does not have a Salmonella
infection will make us
more ready to believe
that she has the flu.
yes
Nausea
Pallor
yes
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Converging Connections
B
C
...
E
A
• Evidence of one of A´s parents has no
influence on the certainty of the others
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
Converging Connections
Advanced
I
WS 06/07
B
C
...
E
A
• Evidence of one of A´s parents has no
influence on the certainty of the others
Bayesian Networks - Bayesian Networks
b
Converging Connections
Advanced
I
WS 06/07
B
...
E
b
A
• Evidence of one of A´s parents has no
influence on the certainty of the others
Bayesian Networks - Bayesian Networks
b
C
Converging Connections
Advanced
I
WS 06/07
B
b
...
E
b
A
• Evidence of one of A´s parents has no
influence on the certainty of the others
Bayesian Networks - Bayesian Networks
b
C
Converging Connections
Advanced
I
WS 06/07
b
C
b
b
...
E
b
A
• Evidence of one of A´s parents has no
influence on the certainty of the others
Bayesian Networks - Bayesian Networks
B
Converging Connections
B
C
A
...
E
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
• However, if anything is known about the
consequence, then information on one possible
cause may tell us something about the other
causes. (explaining away)
Converging Connections
B
C
A
a
...
E
Bayesian Networks - Bayesian Networks
Advanced
I
WS 06/07
• However, if anything is known about the
consequence, then information on one possible
cause may tell us something about the other
causes. (explaining away)
Converging Connections
Advanced
I
WS 06/07
B
C
...
E
A
a
Bayesian Networks - Bayesian Networks
b
• However, if anything is known about the
consequence, then information on one possible
cause may tell us something about the other
causes. (explaining away)
Converging Connections
Advanced
I
WS 06/07
B
...
E
b
A
a
Bayesian Networks - Bayesian Networks
b
C
• However, if anything is known about the
consequence, then information on one possible
cause may tell us something about the other
causes. (explaining away)
Converging Connections
Advanced
I
WS 06/07
B
b
...
E
b
A
a
Bayesian Networks - Bayesian Networks
b
C
• However, if anything is known about the
consequence, then information on one possible
cause may tell us something about the other
causes. (explaining away)
Converging Connections
Advanced
I
WS 06/07
B
E
b
b
A
a
Bayesian Networks - Bayesian Networks
b
...
C
• However, if anything is known about the
consequence, then information on one possible
cause may tell us something about the other
causes. (explaining away)
Advanced
I
WS 06/07
Conitional Independence II:
d-Separation
• The connection is serial or diverging and V is
instantiated, or
• The connection is converging, and neither V nor
any of V´s descendants have reveived evidence.
If A and B are not d-separated, then they are
called d-connected.
Bayesian Networks - Bayesian Networks
Two distinct variables A and B in a Bayesian
network are d-separated if, for all (undirected)
paths between A and B, there is an intermediate
variable V (distinct from A and B) such that
Advanced
I
WS 06/07
d-Separation
(if the connection is serial or diverging
and V is instantiated)
(if the connection is converging, and
Neither V nor any of V´s descendants
have received evidence)
Bayesian Networks - Bayesian Networks
If A and B are d-separated through the
intermediate variable V then
Outline
• Introduction
• Reminder: Probability theory
• Bascis of Bayesian Networks
• Modeling Bayesian networks
• Inference
• Markov Networks
• Learning Bayesian networks
• Relational Models
Bayesian Networks
Advanced
I
WS 06/07
Undirected Relations
Advanced
I
WS 06/07
• Dependence relation R among A,B,C
• Neither desirable nor possible to attach directions
to them
B
C
B
D
C
A
• Add new variable D with states y, n
• Set
• Enter evidence D=y
Bayesian Networks - Modeling
A
Noisy or
Advanced
I
WS 06/07
– Number of cases for each configuration in a
database to small, configurations to specific
for experts, ...
Cold
Agina
Sore throat
?
Bayesian Networks - Modeling
• When a variable A has several parents, you
must specify the CPD for each configuration
of its parents
Advanced
I
WS 06/07
Noisy or
binary variables listing all the
causes of binary
B variable
• Each event
causes
(independently of the other events) unless an
inhibitor prevents it with probability
• Then
where Y is the set of indeces of variables in state y
Bayesian Networks - Modeling
•
Noisy or
Advanced
I
WS 06/07
A1
A2
...
Ak
B1
B2
...
Bk
B
logical or
• Complementary construction is noisy and
Bayesian Networks - Modeling
• linear in the number of parents
•
• Can be modelled directly:
Divorcing
Advanced
I
WS 06/07
A2
A3
...
An
B
Bayesian Networks - Modeling
A1
Divorcing
Advanced
I
WS 06/07
A2
A3
...
An
A1
A2
A3 ... An
C
B
s1,...,sm
B
Bayesian Networks - Modeling
A1
Divorcing
Advanced
I
WS 06/07
A1
A2
A3
...
An
A1
A2
A3 ... An
C
s1,...,sm
B
The set of parents A1,...,Ai for B are divorced from
the parents Ai+1,...,An
Set of configurations c1,...,ck of A1,...,Ai can be
partitioned into the sets s1,...,sm s.t. whenever two
configurations c,c´ are elements of the same si then
Bayesian Networks - Modeling
B
Experts Disagreements
Advanced
I
WS 06/07
• Expert e1,...,en disagree on the conditional
probabilities of a Bayesian network
A
C
D
• Experts disagree on A, D
• Confidences into experts c1,...,cn
e.g. (2, 1, 5, 3, ..., 1)
Bayesian Networks - Modeling
B
Advanced
I
WS 06/07
Expert disagreements
• Introduce a new variable E having the
(confidence) distribution p1,...,pn and link it
to each variable, the tables of which the
experts disagree upon.
A
E
C
D
B
• The child variables have a CPD for each
expert
Bayesian Networks - Modeling
e1,...,eN
Other Models …
Bayesian Networks - Modeling
Advanced
I
WS 06/07
Related documents