SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
Probabilistic Reasoning
 in Bayesian Networks


     KAIST AIPR Lab.
      Jung-Yeol Lee
      17th June 2010


                          1
KAIST AIPR Lab.



Contents

•   Backgrounds
•   Bayesian Network
•   Semantics of Bayesian Network
•   D-Separation
•   Conditional Independence Relations
•   Probabilistic Inference in Bayesian Networks
•   Summary




                                                            2
KAIST AIPR Lab.



Backgrounds

• Bayes’ rule
    From the product rule, P( X  Y )  P( X | Y ) P(Y )  P(Y | X ) P( X )
    P(Y | X )  P( X | Y ) P(Y )  P( X | Y ) P(Y ), where  is the normalization constant
                         P( X )

    Combining evidence e
                       P( X | Y , e) P(Y | e)
      P(Y | X , e) 
                            P( X | e)

• Conditional independence
    P( X , Y | Z )  P( X | Z ) P(Y | Z ) when X            Y|Z



                                                                                               3
KAIST AIPR Lab.



Bayesian Network

• Causal relationships among random variables
• Directed acyclic graph
    Node X i : random variables
    Directed links: probabilistic relationships between variables
    Acyclic: no links from any node to any lower node
• Link from node X to node Y, X is Parent (Y )
• Conditional probability distribution of X i
    P( X i | Parents ( X i ))
    Effect of the parents on the node X i



                                                                         4
KAIST AIPR Lab.



Example of Bayesian Network

• Burglary network                                               P(E)
                                                                 0.002
       P(B)
                      Burglary                  Earthquake
       0.001

                                                        B E      P(A|B,E)
                                                        T    T       0.95
                                        Alarm
                                                        T    F       0.94
   A P(J|A)                                             F    T       0.29
   T   0.90                                             F    F       0.001
   F   0.05        JohnCalls                           Conditional Probability Tables

        Directly influenced by Alarm                             A     P(M|A)
                                                MaryCalls
        P( J | M  A  E  B)  P( J | A)
                                                                 T       0.70
                                                                 F       0.01


                                                                                                 5
KAIST AIPR Lab.



Semantics of Bayesian Network

• Full joint probability distribution
    Notation: P( x1 ,, xn ) abbreviated from P( X1  x1    X n  xn )
                      n
    P( x1 ,, xn )   P( xi | parents ( X i )),
                             i 1

       where parents ( X i ) is the specific values of the variables in Parents ( X i )
• Constructing Bayesian networks
                n

    P( x1 ,, xn )   P(xi | xi 1 ,, x1 ) by chain rule
                      i 1
    For every variable X i in the network,
        •   P( X i | X i 1 ,, X1 )  P( X i | Parents ( X i )) provided that Parents ( X i )  {X i 1 ,, X1}

    Correctness
        • Choose parents for each node s.t. this property holds



                                                                                                                   6
KAIST AIPR Lab.



Semantics of Bayesian Network (cont’d)

• Compactness
    Locally structured system
       • Interacts directly with only a bounded number of components
    Complete network specified by n2 k conditional probabilities
     where at most k parents
• Node ordering
    Add “root causes” first
    Add variables influenced, and so on
    Until reach the “leaves”
       • “Leaves”: no direct causal influence on others



                                                                           7
KAIST AIPR Lab.

Three example of 3-node graphs

Tail-to-Tail Connection
• Node c is said to be tail-to-tail
              c          P(a, b)   P(a | c) P(b | c) P(c)
                                       c

          a       b      a       
                              b| 0

              c         P ( a, b | c ) 
                                           P(a, b, c)
                                                       P(a | c) P(b | c)
                                             P (c )
          a       b     a    b| c

• When node c is observed,
      Node c blocks the path from a to b
      Variables a and b are independent



                                                                                     8
KAIST AIPR Lab.

Three example of 3-node graphs

Head-to-Tail Connection
• Node c is said to be head-to-tail
                      P(a, b)  P(a) P(c | a) P(b | c)  P(a) P(b | a)
        a       c      b                               c

                                 a        
                                       b| 0

                                                    P(a, b, c) P(a) P(c | a) P(b | c)
                                 P ( a, b | c )                                      P(a | c) P(b | c)
        a       c      b                              P (c )          P (c )
                                 a    b| c


• When node c is observed,
      Node c blocks the path from a to b
      Variables a and b are independent



                                                                                                                9
KAIST AIPR Lab.

Three example of 3-node graphs

Head-to-Head Connection
• Node c is said to be head-to-head
                         P(a, b, c)  P(a) P(b) P(c | a, b)
          a       b
                          P(a, b, c)  P(a, b),  P(a) P(b) P(c | a, b)  P(a) P(b)
              c           c                              c

                         a        
                               b| 0

          a       b      P ( a, b | c ) 
                                            P(a, b, c) P(a) P(b) P(c | a, b)
                                                      
                                              P (c )          P (c )
              c          a    b| c

• When node c is unobserved,
      Node c blocks the path from a to b
      Variables a and b are independent



                                                                                               10
KAIST AIPR Lab.



D-separation

• Let A, B, and C be arbitrary nonintersecting sets of nodes
• Paths from A to B is blocked if it includes either,
    Head-to-tail or tail-to-tail node, and node is in C
    Head-to-head node, and node and its descendants is not in C
• A is d-separated from B by C if,
    Any node in possible paths from A to B blocks the path

               a       f             a         f

                   e       b               e       b

                   c                       c
               a b|c                     a b| f
                                                                      11
KAIST AIPR Lab.



Conditional Independence Relations

• Conditionally independent of
                                                    U1               Um
  its non-descendants, given its
  parents                                   Z1j               X              Znj


• Conditionally independent of                       Y1               Yn

  all other nodes, given its
  Markov blanket*
                                                     U1               Um
• In general, d-separation is used for
  deciding independence                      Z1j               X              Znj


                                                      Y1               Yn



                                         * Parents, children, and children’s other parents

                                                                                      12
KAIST AIPR Lab.



Probabilistic Inference In Bayesian Networks

• Notation
    X: the query variable
    E: the set of evidence variables, E1,…,Em
    e: particular observed evidences
• Compute posterior probability distribution P( X | e)
• Exact inference
    Inference by enumeration
    Variable elimination algorithm
• Approximate inference
    Direct sampling methods
    Markov chain Monte Carlo (MCMC) algorithm
                                                                 13
KAIST AIPR Lab.

Exact Inference In Bayesian Networks

Inference By Enumeration
• P( X | e)  P( X , e)    P( X , e, y) where y is hidden var iable
                             y
• Recall,          n

      P( x1 ,, xn )   P( xi | parents ( X i ))
                            i 1
• Computing sums of products of conditional probabilities
• In Burglary example,
                                                                       B       E
      P( B | j, m)  P( B, j, m)    P( B, e, a, j, m)
                                           e   a

        P(b | j , m)    P(b) P(e) P(a | b, e) P( j | a) P(m | a)       A
                        e      a

                    P(b) P(e) P(a | b, e) P( j | a) P(m | a)       J       M
                                   e   a

• O(2n) time complexity for n Boolean variables

                                                                                       14
KAIST AIPR Lab.

Exact Inference In Bayesian Networks

Variable Elimination Algorithm
• Eliminating repeated calculations of Enumeration
       P( B | j, m)  P( B) P( E ) P(a | B, e) P( j | a) P(m | a)
                               e       a




                                           Repeated calculations

                                                                               15
KAIST AIPR Lab.

Exact Inference In Bayesian Networks

Variable Elimination Algorithm (cont’d)
• Evaluating in right-to-left order (bottom-up)                        B         E
      P( B | j, m)  P( B) P( E ) P(a | B, e) P( j | a) P(m | a)
                                     e              a
• Each part of the expression makes factor                                 A

                    P(m | a)               P( j | a)              J         M
         f M ( A)            , f J ( A)  
                     P(m | a               P( j | a 
                                                         
                                                      
• Pointwise product
      f ( A)   P( j | a) P(m | a) 
                                    
                                    
                      P ( j |  a ) P ( m | a ) 
        JM


         f AJM ( B, E )   f A (a, B, E )  f J (a)  f M (a)
                            a

         f E AJM ( B)   f E (e)  f AJM ( B, e)
                        e

         P( B | j , m)  f B ( B)  f E AJM ( B)
                                                                                     16
KAIST AIPR Lab.

Exact Inference In Bayesian Networks

Variable Elimination Algorithm (cont’d)
• Repeat removing any leaf node that is not a query variable or
  an evidence variable
• In Burglary example, P( J | B  true)              B       E
      P( J | b)  P(b) P(e) P(a | b, e) P( J | a) P(m | a)
                          e       a                     m
                                                                      A
                  P(b) P(e) P(a | b, e) P( J | a)
                          e       a
                                                                  J           M
• Time and space complexity
      Dominated by the size of the largest factor
      In the worst case, exponential time and space complexity




                                                                                  17
KAIST AIPR Lab.

Approximate Inference In Bayesian Networks

Direct Sampling Methods
• Generating of samples from known probability distribution
• Sample each variable in topological order
• Function Prior-Sample(bn) returns an event sampled from the prior specified by bn
       inputs: bn, a Bayesian network specifying joint distribution P(X1,…,Xn)

       x ← an event with n elements
       for i=1 to n do
          xi ← a random sample from P(Xi | parents(Xi))
       return x

• S PS ( x1 ,..., xn ) : the probability of specific event from Prior-Sample
                           n
   S PS ( x1 ,..., xn )   P( xi | parents ( X i ))  P( x1 , , xn )
                        i 1

        N PS ( x1 ,..., xn )
   lim                        S PS ( x1 ,..., xn )  P( x1 , , xn ) (Consistent estimate)
   N          N
       where N(x1,...,xn ) is the frequency of the event x1 , , xn
                                                                                                  18
KAIST AIPR Lab.

Approximate Inference In Bayesian Networks

Rejection Sampling Methods
• Rejecting samples that is inconsistent with evidence
• Estimate by counting how often X  x occurs
      P( X | e)  N PS ( X , e)  N PS ( X , e)
       ˆ
                                        N PS (e)
                      P ( X , e)
                                 P ( X | e)       (Consistent estimate)
                       P ( e)
• Rejects samples exponentially as the number of evidence
  variables grows




                                                                                    19
KAIST AIPR Lab.

Approximate Inference In Bayesian Networks

Likelihood weighting
• Generating only consistent events w.r.t. the evidence
      Fixes the values for the evidence variables E
      Samples only the remaining variables X and Y
•   function Likelihood-Weighting(X, e, bn, N) returns an estimate of P(X|e)
      local variables: W, a vector of weighted counts over X, initially zero
      for i=1 to N do
         x, w ← Weighted-Sample(bn, e)
         W[x] ← W[x]+w where x is the value of X in x
    Return Normalize(W[X])

    function Weighted-Sample(bn, e) returns an event and a weight
      x ← an event with n elements; w ← 1
      for i=1 to n do
          if Xi has a value xi in e
               then w ← w  P( X i  xi | parents ( X i ))
               else xi ← a random sample from P( X i | parents ( X i ))
       return x, w


                                                                                       20
KAIST AIPR Lab.

Approximate Inference In Bayesian Networks

Likelihood weighting (cont’d)
• Sampling distribution SWS by Weighted-Sample
             l

      SWS ( z, e)   P( zi | parents (Zi )) where Z  {X} Y
                     i 1
• The likelihood weight w(z,e)
              m
      w( z, e)   P(ei | parents ( Ei ))
                    i 1
• Weighted probability of a sample
                                l                     m
      SWS ( z, e)w( z, e)   P( zi | parents (Z i )) P(ei | parents ( Ei )
                               i 1                   i 1

                             P ( z , e)




                                                                                        21
KAIST AIPR Lab.

Approximate Inference In Bayesian Networks

Markov Chain Monte Carlo Algorithm

• Generating event by random change to one of nonevidence
  variables Zi
• Zi conditioned on current values in the Markov blanket of Zi
• State specifying a value for every variables
• Long-run fraction of time spent in each state  P( X | e)
• functionvariables: N[X], e, bn, N) returns an estimate of P(X|e)
    local
           MCMC-Ask(X,
                           a vector of counts over X, initially zero
                       Z, the nonevidence variables in bn
                       x, the current state of the network, initially copied from e
      initialize x with random values for the variables in Z
      for j=1 to N do
         for each Zi in Z do
            sample the value of Zi in x from P(Zi | mb(Zi )) given the values of mb( Z i ) in x
            N[x]←N[x] + 1 where x is the value of X in x
      return Normalize(N[X])


                                                                                                     22
KAIST AIPR Lab.

Approximate Inference In Bayesian Networks

Markov Chain Monte Carlo Algorithm (cont’d)

• Markov chain on the state space
      q( x  x) : the probability of transition from state x to state x
• Consistency
      Let X i be all the hidden var iables other than X i
       q( x  x)  q(( xi , xi )  ( xi, xi ))  P( xi | xi , e), called Gibbs sampler
      Markov chain reached its stationary distribution if it has detailed
       balance




                                                                                       23
KAIST AIPR Lab.



Summary

• Bayesian network
    Directed acyclic graph expressing causal relationship
• Conditional independence
    D-separation property
• Inference in Bayesian network
    Enumeration: intractable
    Variable elimination: efficient, but sensitive to topology
    Direct sampling: estimate posterior probabilities
    MCMC algorithm: powerful method for computing with
     probability models


                                                                          24
KAIST AIPR Lab.



References

[1] Stuart Russell et al., “Probabilistic Reasoning”, Artificial
     Intelligence A Modern Approach, Chapter 14, pp.492-519
[2] Eugene Charniak, "Bayesian Networks without Tears", 1991
[3] C. Bishop, “Graphical Models”, Pattern Recognition and
     Machine Learning, Chapter 8, pp.359-418




                                                                   25
KAIST AIPR Lab.



Q&A

• Thank you




                      26
KAIST AIPR Lab.



Appendix 1. Example of Bad Node Ordering

• Two more links and unnatural probability judgments
             ①                       ②
                 MaryCalls
                                         JohnCalls




                      ③
                             Alarm



             ④                       ⑤
                 Burglary                Earthquake




                                                               27
KAIST AIPR Lab.



Appendix 2. Consistency of Likelihood Weighting

• P( x | e)    NWS ( x, y, e) w( x, y, e)
  ˆ                                                    from Likelihood-Weighting
                  y

              '  SWS ( x, y, e) w( x, y, e)         for large N
                      y

              '  P ( x, y , e)
                      y

              ' P ( x , e)
             P ( x | e)       (Consistent estimate)




                                                                                      28
KAIST AIPR Lab.



Appendix 2. State Distribution of MCMC

• Detailed balance
     Let πt(x) be the probability of systembeing in state x at time t
         ( x)q( x  x)   ( x)q( x  x) for all x, x

• Gibbs sampler,                 q( x  x)  q(( xi , xi )  ( xi, xi ))  P( xi | xi , e)
      ( x)q( x  x)  P( x | e) P( xi | xi , e)  P( xi , xi | e) P( xi | xi , e)
            P( xi | xi , e) P( xi | e) P( xi | xi , e)   by chain rule on P( xi , xi | e)
            P( xi | xi , e) P( xi, xi | e)                by backwards chain rule
            q(x  x)  (x)
• Stationary distribution if  t   t 1
      t 1 ( x)    ( x)q( x  x)    ( x)q( x  x)
                      x                          x

                    ( x) q( x  x)   ( x)
                             x



                                                                                                        29

Más contenido relacionado

La actualidad más candente

Compressed Sensing and Tomography
Compressed Sensing and TomographyCompressed Sensing and Tomography
Compressed Sensing and TomographyGabriel Peyré
 
Security of continuous variable quantum key distribution against general attacks
Security of continuous variable quantum key distribution against general attacksSecurity of continuous variable quantum key distribution against general attacks
Security of continuous variable quantum key distribution against general attackswtyru1989
 
SPECTRAL SYNTHESIS PROBLEM FOR FOURIER ALGEBRAS
SPECTRAL SYNTHESIS PROBLEM FOR FOURIER ALGEBRASSPECTRAL SYNTHESIS PROBLEM FOR FOURIER ALGEBRAS
SPECTRAL SYNTHESIS PROBLEM FOR FOURIER ALGEBRASKunda Chowdaiah
 
Signal Processing Course : Compressed Sensing
Signal Processing Course : Compressed SensingSignal Processing Course : Compressed Sensing
Signal Processing Course : Compressed SensingGabriel Peyré
 
Masters Thesis Defense
Masters Thesis DefenseMasters Thesis Defense
Masters Thesis Defensessj4mathgenius
 
Elementary Landscape Decomposition of the Quadratic Assignment Problem
Elementary Landscape Decomposition of the Quadratic Assignment ProblemElementary Landscape Decomposition of the Quadratic Assignment Problem
Elementary Landscape Decomposition of the Quadratic Assignment Problemjfrchicanog
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...ijceronline
 
14th Athens Colloquium on Algorithms and Complexity (ACAC19)
14th Athens Colloquium on Algorithms and Complexity (ACAC19)14th Athens Colloquium on Algorithms and Complexity (ACAC19)
14th Athens Colloquium on Algorithms and Complexity (ACAC19)Apostolos Chalkis
 
Quantum Probabilities and Quantum-inspired Information Retrieval
Quantum Probabilities and Quantum-inspired Information RetrievalQuantum Probabilities and Quantum-inspired Information Retrieval
Quantum Probabilities and Quantum-inspired Information RetrievalIngo Frommholz
 
High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...Vissarion Fisikopoulos
 
Sparsity and Compressed Sensing
Sparsity and Compressed SensingSparsity and Compressed Sensing
Sparsity and Compressed SensingGabriel Peyré
 
The Impact of Smoothness on Model Class Selection in Nonlinear System Identif...
The Impact of Smoothness on Model Class Selection in Nonlinear System Identif...The Impact of Smoothness on Model Class Selection in Nonlinear System Identif...
The Impact of Smoothness on Model Class Selection in Nonlinear System Identif...Yusuf Bhujwalla
 
Efficient Edge-Skeleton Computation for Polytopes Defined by Oracles
Efficient Edge-Skeleton Computation for Polytopes Defined by OraclesEfficient Edge-Skeleton Computation for Polytopes Defined by Oracles
Efficient Edge-Skeleton Computation for Polytopes Defined by OraclesVissarion Fisikopoulos
 
Topological Inference via Meshing
Topological Inference via MeshingTopological Inference via Meshing
Topological Inference via MeshingDon Sheehy
 
pres_IGARSS_2011_LFF_poltom.pdf
pres_IGARSS_2011_LFF_poltom.pdfpres_IGARSS_2011_LFF_poltom.pdf
pres_IGARSS_2011_LFF_poltom.pdfgrssieee
 
Reproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
Reproducing Kernel Hilbert Space of A Set Indexed Brownian MotionReproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
Reproducing Kernel Hilbert Space of A Set Indexed Brownian MotionIJMERJOURNAL
 
Wireless Localization: Ranging (second part)
Wireless Localization: Ranging (second part)Wireless Localization: Ranging (second part)
Wireless Localization: Ranging (second part)Stefano Severi
 

La actualidad más candente (18)

Compressed Sensing and Tomography
Compressed Sensing and TomographyCompressed Sensing and Tomography
Compressed Sensing and Tomography
 
Security of continuous variable quantum key distribution against general attacks
Security of continuous variable quantum key distribution against general attacksSecurity of continuous variable quantum key distribution against general attacks
Security of continuous variable quantum key distribution against general attacks
 
SPECTRAL SYNTHESIS PROBLEM FOR FOURIER ALGEBRAS
SPECTRAL SYNTHESIS PROBLEM FOR FOURIER ALGEBRASSPECTRAL SYNTHESIS PROBLEM FOR FOURIER ALGEBRAS
SPECTRAL SYNTHESIS PROBLEM FOR FOURIER ALGEBRAS
 
Signal Processing Course : Compressed Sensing
Signal Processing Course : Compressed SensingSignal Processing Course : Compressed Sensing
Signal Processing Course : Compressed Sensing
 
Masters Thesis Defense
Masters Thesis DefenseMasters Thesis Defense
Masters Thesis Defense
 
Elementary Landscape Decomposition of the Quadratic Assignment Problem
Elementary Landscape Decomposition of the Quadratic Assignment ProblemElementary Landscape Decomposition of the Quadratic Assignment Problem
Elementary Landscape Decomposition of the Quadratic Assignment Problem
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
 
14th Athens Colloquium on Algorithms and Complexity (ACAC19)
14th Athens Colloquium on Algorithms and Complexity (ACAC19)14th Athens Colloquium on Algorithms and Complexity (ACAC19)
14th Athens Colloquium on Algorithms and Complexity (ACAC19)
 
Quantum Probabilities and Quantum-inspired Information Retrieval
Quantum Probabilities and Quantum-inspired Information RetrievalQuantum Probabilities and Quantum-inspired Information Retrieval
Quantum Probabilities and Quantum-inspired Information Retrieval
 
Ben Gal
Ben Gal Ben Gal
Ben Gal
 
High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...
 
Sparsity and Compressed Sensing
Sparsity and Compressed SensingSparsity and Compressed Sensing
Sparsity and Compressed Sensing
 
The Impact of Smoothness on Model Class Selection in Nonlinear System Identif...
The Impact of Smoothness on Model Class Selection in Nonlinear System Identif...The Impact of Smoothness on Model Class Selection in Nonlinear System Identif...
The Impact of Smoothness on Model Class Selection in Nonlinear System Identif...
 
Efficient Edge-Skeleton Computation for Polytopes Defined by Oracles
Efficient Edge-Skeleton Computation for Polytopes Defined by OraclesEfficient Edge-Skeleton Computation for Polytopes Defined by Oracles
Efficient Edge-Skeleton Computation for Polytopes Defined by Oracles
 
Topological Inference via Meshing
Topological Inference via MeshingTopological Inference via Meshing
Topological Inference via Meshing
 
pres_IGARSS_2011_LFF_poltom.pdf
pres_IGARSS_2011_LFF_poltom.pdfpres_IGARSS_2011_LFF_poltom.pdf
pres_IGARSS_2011_LFF_poltom.pdf
 
Reproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
Reproducing Kernel Hilbert Space of A Set Indexed Brownian MotionReproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
Reproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
 
Wireless Localization: Ranging (second part)
Wireless Localization: Ranging (second part)Wireless Localization: Ranging (second part)
Wireless Localization: Ranging (second part)
 

Similar a Jylee probabilistic reasoning with bayesian networks

Pathway Discovery in Cancer: the Bayesian Approach
Pathway Discovery in Cancer: the Bayesian ApproachPathway Discovery in Cancer: the Bayesian Approach
Pathway Discovery in Cancer: the Bayesian ApproachFrancesco Gadaleta
 
Probabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsProbabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsSelman Bozkır
 
Workshop on Bayesian Inference for Latent Gaussian Models with Applications
Workshop on Bayesian Inference for Latent Gaussian Models with ApplicationsWorkshop on Bayesian Inference for Latent Gaussian Models with Applications
Workshop on Bayesian Inference for Latent Gaussian Models with ApplicationsChristian Robert
 
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VECUnit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VECsundarKanagaraj1
 
Fitness inheritance in the Bayesian optimization algorithm
Fitness inheritance in the Bayesian optimization algorithmFitness inheritance in the Bayesian optimization algorithm
Fitness inheritance in the Bayesian optimization algorithmMartin Pelikan
 
AIML unit-2(1).ppt
AIML unit-2(1).pptAIML unit-2(1).ppt
AIML unit-2(1).pptashudhanraj
 
Thesis : "IBBET : In Band Bandwidth Estimation for LAN"
Thesis : "IBBET : In Band Bandwidth Estimation for LAN"Thesis : "IBBET : In Band Bandwidth Estimation for LAN"
Thesis : "IBBET : In Band Bandwidth Estimation for LAN"Vishalkumarec
 
A new approach in specifying the inverse quadratic matrix in modulo-2 for con...
A new approach in specifying the inverse quadratic matrix in modulo-2 for con...A new approach in specifying the inverse quadratic matrix in modulo-2 for con...
A new approach in specifying the inverse quadratic matrix in modulo-2 for con...Anax Fotopoulos
 
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...Gota Morota
 
Naive Bayes Classifier
Naive Bayes ClassifierNaive Bayes Classifier
Naive Bayes ClassifierArunabha Saha
 
Logistic Regression(SGD)
Logistic Regression(SGD)Logistic Regression(SGD)
Logistic Regression(SGD)Prentice Xu
 
Approximate Bayesian Computation on GPUs
Approximate Bayesian Computation on GPUsApproximate Bayesian Computation on GPUs
Approximate Bayesian Computation on GPUsMichael Stumpf
 
ch8Bayes.ppt
ch8Bayes.pptch8Bayes.ppt
ch8Bayes.pptImXaib
 

Similar a Jylee probabilistic reasoning with bayesian networks (19)

Pathway Discovery in Cancer: the Bayesian Approach
Pathway Discovery in Cancer: the Bayesian ApproachPathway Discovery in Cancer: the Bayesian Approach
Pathway Discovery in Cancer: the Bayesian Approach
 
Bayesnetwork
BayesnetworkBayesnetwork
Bayesnetwork
 
Bayesian network
Bayesian networkBayesian network
Bayesian network
 
Probabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsProbabilistic information retrieval models & systems
Probabilistic information retrieval models & systems
 
ML.pptx
ML.pptxML.pptx
ML.pptx
 
Workshop on Bayesian Inference for Latent Gaussian Models with Applications
Workshop on Bayesian Inference for Latent Gaussian Models with ApplicationsWorkshop on Bayesian Inference for Latent Gaussian Models with Applications
Workshop on Bayesian Inference for Latent Gaussian Models with Applications
 
ABC workshop: 17w5025
ABC workshop: 17w5025ABC workshop: 17w5025
ABC workshop: 17w5025
 
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VECUnit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
Unit IV UNCERTAINITY AND STATISTICAL REASONING in AI K.Sundar,AP/CSE,VEC
 
Fitness inheritance in the Bayesian optimization algorithm
Fitness inheritance in the Bayesian optimization algorithmFitness inheritance in the Bayesian optimization algorithm
Fitness inheritance in the Bayesian optimization algorithm
 
AIML unit-2(1).ppt
AIML unit-2(1).pptAIML unit-2(1).ppt
AIML unit-2(1).ppt
 
Thesis : "IBBET : In Band Bandwidth Estimation for LAN"
Thesis : "IBBET : In Band Bandwidth Estimation for LAN"Thesis : "IBBET : In Band Bandwidth Estimation for LAN"
Thesis : "IBBET : In Band Bandwidth Estimation for LAN"
 
A new approach in specifying the inverse quadratic matrix in modulo-2 for con...
A new approach in specifying the inverse quadratic matrix in modulo-2 for con...A new approach in specifying the inverse quadratic matrix in modulo-2 for con...
A new approach in specifying the inverse quadratic matrix in modulo-2 for con...
 
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
 
Naive Bayes Classifier
Naive Bayes ClassifierNaive Bayes Classifier
Naive Bayes Classifier
 
Logistic Regression(SGD)
Logistic Regression(SGD)Logistic Regression(SGD)
Logistic Regression(SGD)
 
Approximate Bayesian Computation on GPUs
Approximate Bayesian Computation on GPUsApproximate Bayesian Computation on GPUs
Approximate Bayesian Computation on GPUs
 
ch8Bayes.ppt
ch8Bayes.pptch8Bayes.ppt
ch8Bayes.ppt
 
ch8Bayes.ppt
ch8Bayes.pptch8Bayes.ppt
ch8Bayes.ppt
 
ch8Bayes.pptx
ch8Bayes.pptxch8Bayes.pptx
ch8Bayes.pptx
 

Último

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

Jylee probabilistic reasoning with bayesian networks

  • 1. Probabilistic Reasoning in Bayesian Networks KAIST AIPR Lab. Jung-Yeol Lee 17th June 2010 1
  • 2. KAIST AIPR Lab. Contents • Backgrounds • Bayesian Network • Semantics of Bayesian Network • D-Separation • Conditional Independence Relations • Probabilistic Inference in Bayesian Networks • Summary 2
  • 3. KAIST AIPR Lab. Backgrounds • Bayes’ rule  From the product rule, P( X  Y )  P( X | Y ) P(Y )  P(Y | X ) P( X )  P(Y | X )  P( X | Y ) P(Y )  P( X | Y ) P(Y ), where  is the normalization constant P( X )  Combining evidence e P( X | Y , e) P(Y | e) P(Y | X , e)  P( X | e) • Conditional independence  P( X , Y | Z )  P( X | Z ) P(Y | Z ) when X Y|Z 3
  • 4. KAIST AIPR Lab. Bayesian Network • Causal relationships among random variables • Directed acyclic graph  Node X i : random variables  Directed links: probabilistic relationships between variables  Acyclic: no links from any node to any lower node • Link from node X to node Y, X is Parent (Y ) • Conditional probability distribution of X i  P( X i | Parents ( X i ))  Effect of the parents on the node X i 4
  • 5. KAIST AIPR Lab. Example of Bayesian Network • Burglary network P(E) 0.002 P(B) Burglary Earthquake 0.001 B E P(A|B,E) T T 0.95 Alarm T F 0.94 A P(J|A) F T 0.29 T 0.90 F F 0.001 F 0.05 JohnCalls Conditional Probability Tables Directly influenced by Alarm A P(M|A) MaryCalls P( J | M  A  E  B)  P( J | A) T 0.70 F 0.01 5
  • 6. KAIST AIPR Lab. Semantics of Bayesian Network • Full joint probability distribution  Notation: P( x1 ,, xn ) abbreviated from P( X1  x1    X n  xn ) n  P( x1 ,, xn )   P( xi | parents ( X i )), i 1 where parents ( X i ) is the specific values of the variables in Parents ( X i ) • Constructing Bayesian networks n  P( x1 ,, xn )   P(xi | xi 1 ,, x1 ) by chain rule i 1  For every variable X i in the network, • P( X i | X i 1 ,, X1 )  P( X i | Parents ( X i )) provided that Parents ( X i )  {X i 1 ,, X1}  Correctness • Choose parents for each node s.t. this property holds 6
  • 7. KAIST AIPR Lab. Semantics of Bayesian Network (cont’d) • Compactness  Locally structured system • Interacts directly with only a bounded number of components  Complete network specified by n2 k conditional probabilities where at most k parents • Node ordering  Add “root causes” first  Add variables influenced, and so on  Until reach the “leaves” • “Leaves”: no direct causal influence on others 7
  • 8. KAIST AIPR Lab. Three example of 3-node graphs Tail-to-Tail Connection • Node c is said to be tail-to-tail c P(a, b)   P(a | c) P(b | c) P(c) c a b a  b| 0 c P ( a, b | c )  P(a, b, c)  P(a | c) P(b | c) P (c ) a b a b| c • When node c is observed,  Node c blocks the path from a to b  Variables a and b are independent 8
  • 9. KAIST AIPR Lab. Three example of 3-node graphs Head-to-Tail Connection • Node c is said to be head-to-tail P(a, b)  P(a) P(c | a) P(b | c)  P(a) P(b | a) a c b c a  b| 0 P(a, b, c) P(a) P(c | a) P(b | c) P ( a, b | c )    P(a | c) P(b | c) a c b P (c ) P (c ) a b| c • When node c is observed,  Node c blocks the path from a to b  Variables a and b are independent 9
  • 10. KAIST AIPR Lab. Three example of 3-node graphs Head-to-Head Connection • Node c is said to be head-to-head P(a, b, c)  P(a) P(b) P(c | a, b) a b  P(a, b, c)  P(a, b),  P(a) P(b) P(c | a, b)  P(a) P(b) c c c a  b| 0 a b P ( a, b | c )  P(a, b, c) P(a) P(b) P(c | a, b)  P (c ) P (c ) c a b| c • When node c is unobserved,  Node c blocks the path from a to b  Variables a and b are independent 10
  • 11. KAIST AIPR Lab. D-separation • Let A, B, and C be arbitrary nonintersecting sets of nodes • Paths from A to B is blocked if it includes either,  Head-to-tail or tail-to-tail node, and node is in C  Head-to-head node, and node and its descendants is not in C • A is d-separated from B by C if,  Any node in possible paths from A to B blocks the path a f a f e b e b c c a b|c a b| f 11
  • 12. KAIST AIPR Lab. Conditional Independence Relations • Conditionally independent of U1 Um its non-descendants, given its parents Z1j X Znj • Conditionally independent of Y1 Yn all other nodes, given its Markov blanket* U1 Um • In general, d-separation is used for deciding independence Z1j X Znj Y1 Yn * Parents, children, and children’s other parents 12
  • 13. KAIST AIPR Lab. Probabilistic Inference In Bayesian Networks • Notation  X: the query variable  E: the set of evidence variables, E1,…,Em  e: particular observed evidences • Compute posterior probability distribution P( X | e) • Exact inference  Inference by enumeration  Variable elimination algorithm • Approximate inference  Direct sampling methods  Markov chain Monte Carlo (MCMC) algorithm 13
  • 14. KAIST AIPR Lab. Exact Inference In Bayesian Networks Inference By Enumeration • P( X | e)  P( X , e)    P( X , e, y) where y is hidden var iable y • Recall, n  P( x1 ,, xn )   P( xi | parents ( X i )) i 1 • Computing sums of products of conditional probabilities • In Burglary example, B E  P( B | j, m)  P( B, j, m)    P( B, e, a, j, m) e a P(b | j , m)    P(b) P(e) P(a | b, e) P( j | a) P(m | a) A e a  P(b) P(e) P(a | b, e) P( j | a) P(m | a) J M e a • O(2n) time complexity for n Boolean variables 14
  • 15. KAIST AIPR Lab. Exact Inference In Bayesian Networks Variable Elimination Algorithm • Eliminating repeated calculations of Enumeration P( B | j, m)  P( B) P( E ) P(a | B, e) P( j | a) P(m | a) e a Repeated calculations 15
  • 16. KAIST AIPR Lab. Exact Inference In Bayesian Networks Variable Elimination Algorithm (cont’d) • Evaluating in right-to-left order (bottom-up) B E  P( B | j, m)  P( B) P( E ) P(a | B, e) P( j | a) P(m | a) e a • Each part of the expression makes factor A   P(m | a)   P( j | a)  J M f M ( A)   , f J ( A)    P(m | a   P( j | a       • Pointwise product  f ( A)   P( j | a) P(m | a)       P ( j |  a ) P ( m | a )  JM f AJM ( B, E )   f A (a, B, E )  f J (a)  f M (a) a f E AJM ( B)   f E (e)  f AJM ( B, e) e P( B | j , m)  f B ( B)  f E AJM ( B) 16
  • 17. KAIST AIPR Lab. Exact Inference In Bayesian Networks Variable Elimination Algorithm (cont’d) • Repeat removing any leaf node that is not a query variable or an evidence variable • In Burglary example, P( J | B  true) B E  P( J | b)  P(b) P(e) P(a | b, e) P( J | a) P(m | a) e a m A  P(b) P(e) P(a | b, e) P( J | a) e a J M • Time and space complexity  Dominated by the size of the largest factor  In the worst case, exponential time and space complexity 17
  • 18. KAIST AIPR Lab. Approximate Inference In Bayesian Networks Direct Sampling Methods • Generating of samples from known probability distribution • Sample each variable in topological order • Function Prior-Sample(bn) returns an event sampled from the prior specified by bn inputs: bn, a Bayesian network specifying joint distribution P(X1,…,Xn) x ← an event with n elements for i=1 to n do xi ← a random sample from P(Xi | parents(Xi)) return x • S PS ( x1 ,..., xn ) : the probability of specific event from Prior-Sample n S PS ( x1 ,..., xn )   P( xi | parents ( X i ))  P( x1 , , xn ) i 1 N PS ( x1 ,..., xn ) lim  S PS ( x1 ,..., xn )  P( x1 , , xn ) (Consistent estimate) N  N where N(x1,...,xn ) is the frequency of the event x1 , , xn 18
  • 19. KAIST AIPR Lab. Approximate Inference In Bayesian Networks Rejection Sampling Methods • Rejecting samples that is inconsistent with evidence • Estimate by counting how often X  x occurs  P( X | e)  N PS ( X , e)  N PS ( X , e) ˆ N PS (e) P ( X , e)   P ( X | e) (Consistent estimate) P ( e) • Rejects samples exponentially as the number of evidence variables grows 19
  • 20. KAIST AIPR Lab. Approximate Inference In Bayesian Networks Likelihood weighting • Generating only consistent events w.r.t. the evidence  Fixes the values for the evidence variables E  Samples only the remaining variables X and Y • function Likelihood-Weighting(X, e, bn, N) returns an estimate of P(X|e) local variables: W, a vector of weighted counts over X, initially zero for i=1 to N do x, w ← Weighted-Sample(bn, e) W[x] ← W[x]+w where x is the value of X in x Return Normalize(W[X]) function Weighted-Sample(bn, e) returns an event and a weight x ← an event with n elements; w ← 1 for i=1 to n do if Xi has a value xi in e then w ← w  P( X i  xi | parents ( X i )) else xi ← a random sample from P( X i | parents ( X i )) return x, w 20
  • 21. KAIST AIPR Lab. Approximate Inference In Bayesian Networks Likelihood weighting (cont’d) • Sampling distribution SWS by Weighted-Sample l  SWS ( z, e)   P( zi | parents (Zi )) where Z  {X} Y i 1 • The likelihood weight w(z,e) m  w( z, e)   P(ei | parents ( Ei )) i 1 • Weighted probability of a sample l m  SWS ( z, e)w( z, e)   P( zi | parents (Z i )) P(ei | parents ( Ei ) i 1 i 1  P ( z , e) 21
  • 22. KAIST AIPR Lab. Approximate Inference In Bayesian Networks Markov Chain Monte Carlo Algorithm • Generating event by random change to one of nonevidence variables Zi • Zi conditioned on current values in the Markov blanket of Zi • State specifying a value for every variables • Long-run fraction of time spent in each state  P( X | e) • functionvariables: N[X], e, bn, N) returns an estimate of P(X|e) local MCMC-Ask(X, a vector of counts over X, initially zero Z, the nonevidence variables in bn x, the current state of the network, initially copied from e initialize x with random values for the variables in Z for j=1 to N do for each Zi in Z do sample the value of Zi in x from P(Zi | mb(Zi )) given the values of mb( Z i ) in x N[x]←N[x] + 1 where x is the value of X in x return Normalize(N[X]) 22
  • 23. KAIST AIPR Lab. Approximate Inference In Bayesian Networks Markov Chain Monte Carlo Algorithm (cont’d) • Markov chain on the state space  q( x  x) : the probability of transition from state x to state x • Consistency  Let X i be all the hidden var iables other than X i q( x  x)  q(( xi , xi )  ( xi, xi ))  P( xi | xi , e), called Gibbs sampler  Markov chain reached its stationary distribution if it has detailed balance 23
  • 24. KAIST AIPR Lab. Summary • Bayesian network  Directed acyclic graph expressing causal relationship • Conditional independence  D-separation property • Inference in Bayesian network  Enumeration: intractable  Variable elimination: efficient, but sensitive to topology  Direct sampling: estimate posterior probabilities  MCMC algorithm: powerful method for computing with probability models 24
  • 25. KAIST AIPR Lab. References [1] Stuart Russell et al., “Probabilistic Reasoning”, Artificial Intelligence A Modern Approach, Chapter 14, pp.492-519 [2] Eugene Charniak, "Bayesian Networks without Tears", 1991 [3] C. Bishop, “Graphical Models”, Pattern Recognition and Machine Learning, Chapter 8, pp.359-418 25
  • 26. KAIST AIPR Lab. Q&A • Thank you 26
  • 27. KAIST AIPR Lab. Appendix 1. Example of Bad Node Ordering • Two more links and unnatural probability judgments ① ② MaryCalls JohnCalls ③ Alarm ④ ⑤ Burglary Earthquake 27
  • 28. KAIST AIPR Lab. Appendix 2. Consistency of Likelihood Weighting • P( x | e)    NWS ( x, y, e) w( x, y, e) ˆ from Likelihood-Weighting y   '  SWS ( x, y, e) w( x, y, e) for large N y   '  P ( x, y , e) y   ' P ( x , e)  P ( x | e) (Consistent estimate) 28
  • 29. KAIST AIPR Lab. Appendix 2. State Distribution of MCMC • Detailed balance  Let πt(x) be the probability of systembeing in state x at time t  ( x)q( x  x)   ( x)q( x  x) for all x, x • Gibbs sampler, q( x  x)  q(( xi , xi )  ( xi, xi ))  P( xi | xi , e)   ( x)q( x  x)  P( x | e) P( xi | xi , e)  P( xi , xi | e) P( xi | xi , e)  P( xi | xi , e) P( xi | e) P( xi | xi , e) by chain rule on P( xi , xi | e)  P( xi | xi , e) P( xi, xi | e) by backwards chain rule  q(x  x)  (x) • Stationary distribution if  t   t 1   t 1 ( x)    ( x)q( x  x)    ( x)q( x  x) x x   ( x) q( x  x)   ( x) x 29