Module 2 Bayesian Network Model and Inference
Module 2 Bayesian Network Model and Inference
Subject Incharge
Dr. Bidisha Roy
Associate Professor
Room No. 401
email: [email protected]
Topics to be covered
❑ Bayesian Network-Exploiting Independence Properties
❑Naive Bayes Model
❑Bayesian Network Model
❑Reasoning Patterns
❑Basic Independencies in Bayesian Networks
❑Bayesian Network Semantics,
❑Graphs and Distributions
❑ Modelling: Picking variables, Picking Structure, Picking
Probabilities,
❑Dseparation
St. Francis Institute of Technology PGM
Department of Computer Engineering Dr. Bidisha Roy 3
The material in this presentation belongs to St. Francis Institute of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.
What?
❑ A Bayesian Network (BN), or a Bayesian Model is a directed
PGM, that represents a set of random variables and their
dependencies using a DAG
A Bayesian Network
A Bayesian network is made up of:
1. A Directed Acyclic Graph
A
C D
2. A set of tables for each node in the graph
A P(A) A B P(B|A) B D P(D|B) B C P(C|B)
false 0.6 false false 0.01 false false 0.02 false false 0.4
true 0.4 false true 0.99 false true 0.98 false true 0.6
true false 0.7 true false 0.05 true false 0.9
true true 0.3 true true 0.95 true true 0.1
St. Francis Institute of Technology PGM
Department of Computer Engineering Dr. Bidisha Roy 5
The material in this presentation belongs to St. Francis Institute of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.
C D
Bayesian Networks
❑ Two important properties:
1. Encodes the conditional independence relationships
between the variables in the graph structure
2. Is a compact representation of the joint probability
distribution over the variables
Example
A P(A) A B P(B|A) Suppose you want to calculate:
false 0.6 false false 0.01 P(A = true, B = true, C = true, D = true)
true 0.4 false true 0.99
true false 0.7
= P(A = true) * P(B = true | A = true) *
true true 0.3 P(C = true | B = true) P( D = true | B =
true)
B C P(C|B)
= (0.4)*(0.3)*(0.1)*(0.95)
false false 0.4
false true 0.6 A
true false 0.9
true true 0.1
B
B D P(D|B)
false false 0.02
C D
false true 0.98
true false 0.05
St. Francis Institute of Technology true true 0.95 PGM
Department of Computer Engineering Dr. Bidisha Roy 11
The material in this presentation belongs to St. Francis Institute of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.
Another Example
Inference
Inference Example
Supposed we know that A=true. A
What is more probable C=true or D=true?
For this we need to compute B
P(C=t | A =t) and P(D=t | A =t).
Let us compute the first one.
C D
P( A = t, C = t )
P( A = t , B = b, C = t , D = d )
P (C = t | A = t ) = = b ,d
P( A = t ) P( A = t )
https://www.youtube.com/watch?v=z8K-598fqSo
Applications https://www.youtube.com/watch?v=fOK9DiKUGYs
D-separation
❑ A criterion for deciding from a given causal/conditional graph,
whether a set of variables X is independent of other set of
variables Y, given a third set Z
“A variable or set of variables X is d-separated from Y
❑ Associates “dependence” with connectedness (existence of a
connecting path), and “independence” with unconnected-ness
or separation
❑ Helps in simplifying the network by identifying independent
relationships, which reduces computational complexity
D-separation
❑ Direct Connection between X and Y
❑X and Y are correlated regardless of
any evidence about any other variables
❑If X and Y are directly connected we
can get examples where they influence
each other regardless of Z
D-separation
❑ Indirect Connection between X and Y
(four cases)
❑Indirect causal effect
❑Indirect evidential effect
❑Common cause
❑Common effect
D-separation
❑ Indirect Causal Effect (X → Z → Y)
❑Cause X cannot influence effect Y if Z
observed
❑Observed Z blocks influence
❑If Grade observed then I does not
influence L
❑Intelligence influences Letter if Grade is
unobserved
D-separation
❑ Indirect Evidential Effect (Y → Z → X)
❑Evidence X can influence Y via Z only if Z is
unobserved
❑Observed Z blocks the influence
❑If Grade unobserved, Letter influences
assessment of Intelligence
❑Dependency is a symmetric notion
❑X ⊥ Y does not hold then Y ⊥ X does not
hold either
D-separation
❑ Common Cause(X Z → Y)
❑X can influence Y if and only if Z is not
observed
❑Observed Z blocks the influence
❑Grade is correlated with SAT score
❑But if Intelligence is observed then
SAT provides no additional
information
D-separation
❑ Common Effect
(V-Structure) (X → Z Y)
❑Influence cannot flow on trail
X Z →Y if Z is not observed
❑Observed Z enables
❑Opposite to previous 3 cases
(Observed Z blocks)\
❑When G not observed I and D are
independent
❑When G is observed, I and D are
correlated
St. Francis Institute of Technology PGM
Department of Computer Engineering Dr. Bidisha Roy 29
The material in this presentation belongs to St. Francis Institute of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.
D-separation
❑Is V ⊥ Z? Not d-separated or not conditionally
independent
❑ Is (V ⊥ Z)/T? d-separated or conditionally
independent as T blocks the
active path
❑Is (U ⊥ V)? d-separated as all paths are
blocked (due to common effect)
❑Is (U ⊥ V)/W? Not d-separated as W being
active becomes a collider
❑Is (U ⊥ V)/X? d-separated as both paths
inactive
❑Is (U ⊥ V)/Y? Not d-separated as the first path
becomes active due to Y
St. Francis Institute of Technology PGM
Department of Computer Engineering Dr. Bidisha Roy 32
The material in this presentation belongs to St. Francis Institute of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.
D-separation
❑Is (U ⊥ V)/Z? d-separated as the both paths
inactive
❑Is (W ⊥ X)? Not d-separated as WV→X is
active
❑Is (X ⊥ T)/V? d-separated as the both paths
inactive
❑Is (X ⊥ W)/U? Not d-separated as WV→X is
active
❑Is (Y ⊥ Z)? Not d-separated as
YXV→T→Z is active
❑Is (Y ⊥ Z)/T? d-separated as the both paths
inactive
St. Francis Institute of Technology PGM
Department of Computer Engineering Dr. Bidisha Roy 33
The material in this presentation belongs to St. Francis Institute of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.
D-separation
❑Is (Y ⊥ Z)/T? Not d-separated as one path is
active
❑Is (Y ⊥ Z)/V? d-separated as both paths are
inactive
❑Is (W ⊥ Z)/V? d-separated as both paths are
inactive
❑Is (U ⊥ Z)? d-separated as both paths are
inactive
❑Is (U ⊥ Z)/Y? Not d-separated as 1st path is
active
https://www.youtube.com/watch?v=i0CGsHhjISU&t=628s