SlideShare a Scribd company logo
1 of 62
Download to read offline
1

                        Bayesian Networks
            Unit 3
Uncertainty Inference:Discrete
                    Wang, Yuan-Kai, 王元凱
                        ykwang@mails.fju.edu.tw
                         http://www.ykwang.tw

       Department of Electrical Engineering, Fu Jen Univ.
                     輔仁大學電機工程系

                                   2006~2011
                             Reference this document as:
                 Wang, Yuan-Kai, “Uncertainty Inference - Discrete,"
          Lecture Notes of Wang, Yuan-Kai, Fu Jen University, Taiwan, 2011.
Fu Jen University    Department of Electrical Engineering   Wang, Yuan-Kai Copyright
王元凱                              Unit - Uncertainty Inference (Discrete)                       p.



                           Goal of this Unit
      • Review advanced concepts of statistics
           – Statistical Inference
           – Pattern recognition




       2
       Fu Jen University     Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                            Unit - Uncertainty Inference (Discrete)                       p.




                           Related Units
      • Previous unit(s)
           – Probability Review
           – Statistics Review
      • Next units
           – Uncertainty Inference (Continuous)




       3
       Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                            Unit - Uncertainty Inference (Discrete)                       p.




                             Self-Study
      • Artificial Intelligence: a modern approach
        – Russell & Norvig, 2nd, Prentice Hall, 2003.
          pp.462~474,
        – Chapter 13, Sec. 13.1~13.3
      • 統計學的世界
           – 墨爾著,鄭惟厚譯, 天下文化,2002
      • 深入淺出統計學
           – D. Grifiths, 楊仁和譯,2009, O’ Reilly

       4
       Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                            Unit - Uncertainty Inference (Discrete)                       p. 5




                               Contents
      1.   Acting Under Uncertainty ………………….                                            6
      2.   Basic Probability ..................………..…….                                15
      3.   Marginal Probability ..……..........................                         27
      4.   Inference Using Full Joint Distribution ...                                 30
      5.   Independence ............................................                   43
      6.   Bayes' Rule and Its Use ............................                        47
      7.   Summary …………………………………….                                                     62



      5
      Fu Jen University    Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                                   Unit - Uncertainty Inference (Discrete)                       p. 6




         1. Acting Under Uncertainty
                               sensors
                                                     ?
                           ?
                                                                       environment
                          agent                      ?
                                  actuators


                                                          model



      Fu Jen University           Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 7



          Example 1-Localization (1/3)
      • Where is it
           – It is a robot
           – Sensor: camera, laser range finder, sonar
           – State: (x, y, orientation), Prob.




      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 8




          Example 1-Localization (2/3)
      • Where is it
           – It is a mobile station/robot
           – Sensor: Wireless LAN
           – State: (x, y), Prob.




      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                               Unit - Uncertainty Inference (Discrete)                       p. 9




            Example 1-Localization (3/3)
        • Where is it
             – It is a moving text
             – Sensor: computer vision techniques
             – State: (x, y, moving direction), Prob.

      t-3           t-2     t-1             t




                                                                 Output                                 t
        Fu Jen University     Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                            Unit - Uncertainty Inference (Discrete)                       p. 10



            Example 2-Correlation of
          Features and Words of Color
      • Word of color                   • Feature of color (Average)
                                              RGB=(255,0,0)
         – Red                                RGB=(220,10,10)
                                              RGB=(223,0,0)
                   Uncertainty
                                              RGB=(180,20,20)

         – Light red                          RGB=(150,30,30)
                                              RGB=(147,25,25)
            ...
       Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 11




      Example 3-Target Tracking for Robot




      • The robot must keep
        the target in view
      • The target’s trajectory
        is not known in
        advance                                                           target
                                                           robot
      • The environment may
        or may not be known
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                               Unit - Uncertainty Inference (Discrete)                       p. 12




              Inaccuracy & Uncertainty
          Sensor Inaccuracy




                                 • Movement Inaccuracy


                             Environmental
                              Uncertainty
      Fu Jen University       Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                             Unit - Uncertainty Inference (Discrete)                       p. 13




                          Degree of Belief
      • Probability theory
           – Assigns a numerical degree of belief
             between 0 and 1 to an evidence
           – Provides a way of summarizing the
             uncertainty



      Fu Jen University     Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 14



           Techniques for Uncertainty
      • Bayes rule/Bayesian network with
        probability theory
      • Certainty factor in expert system
      • Fuzzy theory with possibility theory
      • Dempster-Shafer theory


      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 15




                      2. Basic Probability
       • Terms
            – Random variables
            – Full joint distribution (FJD)
            – Conditional probability table (CPT)




      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                             Unit - Uncertainty Inference (Discrete)                       p. 16




                          Random Variable
      • Boolean random variable
           – Rain : true, false
      • Discrete random variable
           – Rain: cloudy, sunny, drizzle, drench
      • Continuous random variable
           – Rain: rainfall in millimeter
             We will focus on Boolean & discrete
             cases in most examples of this book
      Fu Jen University     Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 17




          For Boolean & Discrete R.V.
      • P(X) is a vector
      • Boolean R.V.
          – Rain: true, false
          – P(Rain) = <0.72, 0.28>
      • Discrete R.V.
          – Rain: cloudy, sunny, drizzle, drench
          – P(Rain) = <0.72, 0.1, 0.08, 0.1>
          – Normalized, i.e. sums to 1
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 18




            Full Joint Distribution (1/3)
      • For a set of random variables
        { X1 , X2 ,  , Xn }
      • X1  X2    Xn are atomic events
      • P(X1  X2    Xn) is
          – A full joint probability distribution
          – A table of all joint prob. of all atomic
            events, if {X1,  , Xn} are discrete
      • All questions about probability of
        joint events can be answered by the
        table
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                                  Unit - Uncertainty Inference (Discrete)                         p. 19



            Full Joint Distribution (2/3)
      • Ex: X1: Rain, X2: Wind
           – X1: drizzle, drench, cloudy,
           – X2: strong, weak
           – X1  X2 are atomic events
           – P(X1  X2) is a 3x2 matrix of values
                          Rain      Drizzle               Drench               Cloudy
           Wind
           Strong                   0.15                  0.12                 0.06
           Weak                     0.55                  0.08                 0.04
             P(X1=drizzle  X2=strong) = 0.15, ...
      Fu Jen University          Department of Electrical Engineering            Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 20




            Full Joint Distribution (3/3)
      • All questions about probability of
        joint events can be answered by the
        table
          – P(Wind=Strong),
            P(Rain=Drizzle  Wind=Strong), ...




      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                              Unit - Uncertainty Inference (Discrete)                       p. 21



                          Posterior v.s. Prior
                            Probabilities
      • P(Cavity|Toothache)
           – Conditional probability
           – Posterior probability
             (after the fact/evidence)
      • P(Cavity)
           – Prior probability (the fact)


      Fu Jen University      Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                             Unit - Uncertainty Inference (Discrete)                       p. 22




                          An Example (1/2)
      • For a dental diagnosis
          – Let {Cavity,Toothache} be a set of
            Boolean random variables
      • Denotations for Boolean R.V.
          – P(Cavity=true) = P(cavity)
          – P(Cavity=false) = P(cavity)



      Fu Jen University     Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                              Unit - Uncertainty Inference (Discrete)                       p. 23



                           An Example (2/2)
      • The full joint probability
        distribution P(Toothache  Cavity)
                              toothache toothache
                   cavity       0.04      0.06
                  cavity        0.01                        0.89
      P(cavity  toothache)  0.04  0.01  0.06  0.11
       P (cavity | toothache)
          P (cavity  toothache)      0.04
                                              0.80
              P (toothache)        0.04  0.01
       Fu Jen University     Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 24




       Conditional Probability (Math)
      • P(X1=x1i| X2 =x2j) is a conditional
        probability
      • P(X1 | X2) is a conditional
        distribution function
           – All P(X1=x1i| X2 =x2j) for all possible i, j
      • For Boolean & discrete R.V.s,
        conditional distribution function is a
        table
           – Conditional distribution of continuous
             R.V. will not used in our discussions
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                                Unit - Uncertainty Inference (Discrete)                       p. 25



        Conditional Probability Table
                   (CPT)
      • For the dental diagnosis problem,
           – Toothache & Cavity are Boolean R.V.s
           – P(Toothache|Cavity) is a CPT
       Cavity P(toothache|Cavity) P(toothache|Cavity)
        T          0.90                   0.1
        F          0.05                   0.95
                          Cavity     P(toothache|Cavity)
                           T             0.90
                           F             0.05
      Fu Jen University        Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                              Unit - Uncertainty Inference (Discrete)                       p. 26




                             CPT v.s. FJD
                               toothache toothache
                    cavity       0.04      0.06
                   cavity         0.01                         0.89
                     Sum of all atomic events = 1

      Cavity P(toothache|Cavity) P(toothache|Cavity)
       T          0.90                   0.1
       F          0.05                   0.95
                             Sum of a row = 1
      Fu Jen University      Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                                 Unit - Uncertainty Inference (Discrete)                       p. 27




                  3. Marginal Probability
           P( X i )          P(e )
                          e j E ( X i )
                                              j        Marginal probability
      • Probability of a random variable is the
        sum of the probabilities of the atomic
        events containing the random variable
      • Marginalization (summing out)
                                                            P(toothache)
               toothache toothache                         =P(toothache  cavity)+
cavity           0.04      0.06
                                                             P(toothache  cavity)
cavity          0.01      0.89
                                                            =0.04 + 0.01 = 0.05
      Fu Jen University        Department of Electrical Engineering           Wang, Yuan-Kai Copyright
王元凱                                  Unit - Uncertainty Inference (Discrete)                       p. 28




               Marginal Probability (1/2)
      • Suppose a problem of a world
        contains only 3 random variables
        {X1, X2, X3}
             P( X        1    X2  X3) 1

            P( X 1  X 2 )               P( X
                                      x3 X 3
                                                           1    X 2  X 3  x3 )

            P( X1  x1  X2  x2 )
             P( X1  x1  X2  x2  X3  x3 )
                x3X3
      Fu Jen University          Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                                  Unit - Uncertainty Inference (Discrete)                       p. 29




               Marginal Probability (2/2)
      • Using higher order joint probability
        to calculate marginal and other
        lower order joint probability
          P( X 1  x1 )                   P( X
                                      x 2  X 2
                                                             1    x1  X 2  x2 )

                  P( X
               x 2  X 2 x3 X 3
                                            1    x1  X 2  x2  X 3  x3 )

      Fu Jen University        Department of Electrical Engineering            Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 30



         4. Inference Using Full Joint
                 Distributions
      • Probabilistic inference
           – Uses the full joint distribution as the
             "knowledge base"
           – Is the computation from observed
             evidence of posterior probabilities for
             query
                • Compute conditional probability
      • The most simple inference method:
        Inference by enumeration
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 31




      The Dental Diagnosis Example
      • The set of random variables:
        Toothache, Cavity, and Catch
            – All are Boolean random variables
            – Note: P(toothache)  P(Toothache=true)
      • The full joint distribution is a 2x2x2
        table


      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 32




             The Full Joint Distribution




      • 8 atomic events (sum=1)
           – P(toothachecatch cavity)=0.108
           – P(toothachecatch cavity)=0.16
           – P(toothachecatch cavity)=0.012
           – P(toothachecatch cavity)=0.064
           – ...
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 33




             Inference by Enumeration
      • P(cavity|toothache)
            P(cavity  toothache)
          
                 P(toothache)
      • We can answer the query by
         –Enumerating P(cavitytoothache)
             from the full joint distribution
            –Enumerating P(toothache) from the full
             joint distribution
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                              Unit - Uncertainty Inference (Discrete)                         p. 34




                          Joint Probability
      • P(cavity  toothache)                                             Order-2 joint
            = 0.016+0.064 = 0.08                                           probability




                          Marginal probability
      Fu Jen University      Department of Electrical Engineering            Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 35




                      Marginal Probability
      • P(toothache)
           = 0.108+0.012+0.016+0.064 = 0.2




               Marginal probability of Toothache
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 36




                  Conditional Probability
      • P(cavity|toothache)
          P (cavity  toothache)   0.08
                                        0 .4
               P (toothache)        0.2




      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 37



                          An Exercise
      • P(cavity  toothache)
            P(Cavity=true  Toothache=true)
           = 0.108+0.012+0.072+0.008+0.016+0.064
           = 0.28




      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                              Unit - Uncertainty Inference (Discrete)                       p. 38



                          Normalization (1/2)
      • P(cavity|toothache) and
        P(cavity|toothache) have the same
        denominator P(toothache)
                                  P(cavity  toothache)
         P(cavity | tootheache) 
                                     P(toothache)
                                    P(cavity  toothache)
          P(cavity | tootheache) 
                                        P(toothache)
         • 1/P(toothache) can be viewed as a
           normalization constant for probability
           calculation and derivation
      Fu Jen University      Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                              Unit - Uncertainty Inference (Discrete)                       p. 39



                          Normalization (2/2)
      • P(cavity|toothache)
        =  P(cavitytoothache)
      • P(cavity|toothache)
        =  P(cavitytoothache)
        =  [ P(cavitytoothache  catch)
             + P(cavitytoothache  catch) ]
        =  [ 0.108 + 0.012 ]
        =   0.12 = 0.6


      Fu Jen University      Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                                  Unit - Uncertainty Inference (Discrete)                       p. 40


                          A General Inference
                            Procedure (1/2)
      • Let P(X|E=e) be the query
          – X be the query variable
          – E be the set of evidence variables
          – e be the observed values of E
          – H be the remaining unobserved variables
            (Hidden variables)
      • Inference of the query P(X|E=e) is
                  P ( X | E  e)  P ( X  E  e )
                                               1

                     P ( X  E  e  H  h)
                   2       hH
      Fu Jen University          Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                              Unit - Uncertainty Inference (Discrete)                       p. 41



                          A General Inference
                            Procedure (2/2)
      • E.x.: Query P(cavity|toothache)
      – X: Cavity, E/e: Toothache/true,
        H: Catch
 P (cavity | toothache )      P ( X | E  e)
  P(cavity  toothache)       P ( X  E  e)
   [ P(cavity  toothache  catch )       P( X  E  e  H  h)
      P (cavity  toothache  catch )]     hH




      Fu Jen University      Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 42


           Complexity of the
       Enumeration-based Inference
               Algorithm
      • For n Boolean R.V.s
           – Space complexity: O(2n)
             (Store the full joint distribution)
           – Time complexity: O(2n) (worst case)
      • For n discrete R.V.s, all have d discrete
        values
           – Time complexity: O(dn) (worst case)
           – Space complexity: O(dn)
      • It is not a practical algorithm,
      • More efficient algorithm is needed
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                             Unit - Uncertainty Inference (Discrete)                       p. 43




                          5. Independence
      • A and B are independent iff
           – P(A|B) = P(A), or
           – P(B|A) = P(B), or
           – P(AB) = P(A)P(B)

                           A                B              



      Fu Jen University     Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 44



      The Dental Diagnosis Example
                   (1/2)
      • Original example: 3 random variables
      • Add a fourth variable: Weather
           – The Weather variable has 4 values
           – The full joint distribution:
             P(Toothache,Catch,Cavity,Weather)
             has 32 elements (2x2x2x4)
      • By commonsense, Weather is independent
        of the original 3 variables
           – P(ToothacheCatch  Cavity  Weather)
             = P(Toothache  Catch  Cavity)P(Weather)
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 45



      The Dental Diagnosis Example
                   (2/2)
      • P(Toothache,Catch,Cavity,Weather)
        = P(Toothache,Catch,Cavity)P(Weather)
           – The 32-element table for 4 variables can be
             constructed from
              • One 8-element table, and
              • One 4-element table
           – Reduced from 32 elements to 12
             elements


      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 46




        Advantages of Independence
      • Independence can dramatically
        reduce the amount of elements of the
        full distribution table
           – i.e., independence can help in reducing
                • The size of the domain representation, and
                • The complexity of the inference problem
      • Independence are usually based on
        knowledge of the domain

      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 47




            6. Bayes' Rule and Its Use
      • Given two random variables X, Y
      • By product rule
             P( X  Y )  P( X | Y )P(Y )
             P( X  Y )  P(Y | X )P( X )
                             P( X | Y ) P(Y )
                P(Y | X ) 
                                 P( X )
       •   Bayes' rule underlies all modern AI
           systems for probabilistic inference
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                                 Unit - Uncertainty Inference (Discrete)                         p. 48




                            Bayes’ Theorem
                             Likelihood                                          Prior

                                         P (e / h ) P ( h )
                             P (h / e) 
                                              P (e)

       Posterior                                                          Probability of
                                                                          Evidence
      Probability of an hypothesis, h, can be updated when evidence, e, has been
      obtained.
      Note: it is usually not necessary to calculate P(e) directly as it can be obtained
      by normalizing the posterior probabilities, P(hi | e).

        Fu Jen University       Department of Electrical Engineering            Wang, Yuan-Kai Copyright
王元凱                                   Unit - Uncertainty Inference (Discrete)                            p. 49



                            A Simple Example
      Consider two related variables:
      1. Drug (D) with values y or n
      2. Test (T) with values +ve or –ve
      And suppose we have the following probabilities:
      P(D = y) = 0.001
      P(T = +ve | D = y) = 0.8
      P(T = +ve | D = n) = 0.01
      These probabilities are sufficient to define a joint probability distribution.
      Suppose an athlete tests positive. What is the probability that he has taken
      the drug?
                                                  P (T   ve | D  y ) P ( D  y )
        P(D  y|T   ve)    
                                 P (T   ve | D  y ) P ( D  y )  P (T   ve | D  n ) P ( D  n )
                                                             0.8  0.001
                             
                                                     0.8  0.001  0.01  0.999
                                                              0.074
        Fu Jen University         Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                                       Unit - Uncertainty Inference (Discrete)                                   p. 50




                   A More Complex Case
  Suppose now that there is a similar link between Lung Cancer (L) and a chest X-
  ray (X) and that we also have the following relationships:
  History of smoking (S) has a direct influence on bronchitis (B) and lung cancer
  (L);
  L and B have a direct influence on fatigue (F).
  What is the probability that someone has bronchitis given that they smoke, have

                                                       P(b , s f , x , l )
  fatigue and have received a positive X-ray result?
                                                                                    1       1   1   1
                                  P(b , s , f , x )
              P(b | s , f , x )               1
                                                      1       1       1     l

                                                       P(b, s , f , x , l )
                   1      1   1   1
                                   P( s , f , x )  1       1       1                    1       1   1
                                                                           b ,l
  where, for example, the variable B takes on values b1 (has bronchitis) and b2
  (does not have bronchitis).
  R.E. Neapolitan, Learning Bayesian Networks (2004)

      Fu Jen University               Department of Electrical Engineering                      Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 51



                          An Example
      • Prior knowledge
          – The probability of a patient has meningitis
            is 1/50,000: P(m)=1/50000
          – The probability of a patient has stiff neck
            is 1/20: P(s)=1/20
          – The meningitis causes the patient to have a
            stiff neck 50% of the time: P(s|m)=0.5
      • The probability of a stiff-neck patient
        has meningitis
                   P(s | m)P(m) 0.51/ 50000
        P(m | s)                            0.0002
                       P(s)         1/ 20
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 52




       Generalization of Bayes’ Rule
      • Conditionalized on more evidences, say
         e                   P ( X | Y , e) P (Y | e)
              P(Y | X , e) 
                                   P ( X | e)
       • P(Cavity|toothachecatch)
         = (P(toothachecatch|Cavity)P(Cavity))
           / P(toothachecatch)
        => P(toothache  catch  Cavity)
             / P(toothachecatch)               Better way?
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 53



                     Use Independence in
                       Conditional (1/2)
      • Probe Catch and Toothache are
        independent, given the presence or the
        absence of a Cavity
           – Both Catch and Toothache are caused by
             Cavity, but neither has a direct effect on
             the other
      • P(toothachecatch|Cavity)
        = P(toothache|Cavity) P(catch|Cavity)
      • Conditional independence
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 54



                     Use Independence in
                       Conditional (2/2)
      • If Catch is conditionally independent
        of Toothache given Cavity
      • Equivalent statements
           – P(Catch  Toothache|Cavity)
             =P(Catch|Cavity) P(Toothache|Cavity)
           – P(Catch|ToothacheCavity)
             =P(Catch|Cavity)
           – P(Toothache|CatchCavity)
             =P(Toothache|Cavity)
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 55


      Conditional Independency for the
       Dentist Diagnosis Problem (1/2)
      • The conditional independence, like
        independence, can also decompose the
        full joint distribution into smaller pieces
      • P(Toothache  Catch  Cavity)
      • = P(Toothache  Catch|Cavity)P(Cavity)
          (by product rule)
      • = P(Toothache|Cavity) P(Catch|Cavity)
          P(Cavity)
          (by definition of conditional
           independence)
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                            Unit - Uncertainty Inference (Discrete)                       p. 56


       Conditional Independency for the
        Dentist Diagnosis Problem (2/2)
      • P(Toothache  Catch  Cavity) has
        23-1 elements
      • P(Toothache|Cavity)P(Catch|Cavity)P(Cavity)
        has 2+2+1=5 elements
              P(toothache|Cavity) P(toothache|Cavity)
      cavity         0.9                   0.1
      cavity        0.05                  0.95
              Conditional Probability Table (CPT)
       • Conditional independence can reduce the
         amount of probabilities
       Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 57



               Probabilistic Modeling of
                   Problems (1/2)
      • Usually random variables have two
        semantics
           – Cause
           – Effect
      • Conditional probability P(Y|X) can
        be rewritten as P(Cause|Effect) or
        P(Effect|Cause)

      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 58



               Probabilistic Modeling of
                   Problems (2/2)
      • We usually assume some effects are
        conditionally independent given a
        cause
         – P(effect1  effect2 | cause)
           = P(effect1 | cause) P(effect2 | cause)
        The conditional
        independence can be
        drawn as a graphic model
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 59



            Advantages of Conditional
                 Independence
      • The use of conditional independence
        reduces the size of the joint
        distribution from O(2n) to O(n)
      • Conditional independence is our
        most basic and robust form of
        knowledge about uncertain
        environments

      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 60



             Conditional Independence
                      (Math)
      • If P(Xi|Xj,X)=P(Xi|X), we say that variable
        Xi is conditional independent of Xj, given X
         – Denoted as I(Xi,Xj|X)
         – It means for Xi, if we know X, we can ignore
           Xj
      • If I(Xi,Xj|X), P(Xi,Xj|X) = P(Xi|X) P(Xj|X)
         – By chain rule, P(Xi,Xj|X) = P(Xi|Xj,X) p(Xj|X)
         – Since p(Xi|Xj,X)=p(Xi|X),
         – Then p(Xi,Xj|X)= p(Xi|X) p(Xj|X)
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright
王元凱                             Unit - Uncertainty Inference (Discrete)                              p. 61



                 Pairwise Independence
      • A generalization of pairwise independence
          – We say that the variables X1, …, Xn are
            mutually conditionally independent, given a
                                                n
            set X   p( X 1 , X 2 , X n | X )   p( X i | X )
       Why?                                    i 1
                                                    n
          By chain rule P( X 1 , X 2 ,, X n )   P( X i | X i 1 ,, X 1 )
                                                                      n i 1
                           P( X 1 , X 2 ,  , X n | X )   P( X i | X i 1 ,  , X 1 , X )
                                                                     i 1
       Since Xi is conditional independent of the others given X
                                                                            n
                           p( X 1 , X 2 , X n | X )   p( X i | X )
                                                                          i 1
  When X is empty, we have p(X1,X2, …,Xn)=p(X1)p(X2)…p(Xn)
      Fu Jen University     Department of Electrical Engineering                 Wang, Yuan-Kai Copyright
王元凱                           Unit - Uncertainty Inference (Discrete)                       p. 62



                          7. Summary
      • The full joint distribution can
        answer any query of the domain
           – However, it is intractable
      • Independence and conditional
        independence is important for the
        reduction of the full joint
        distribution
      • We can now move on to
        Bayesian networks
      Fu Jen University   Department of Electrical Engineering          Wang, Yuan-Kai Copyright

More Related Content

Viewers also liked (6)

01 Probability review
01 Probability review01 Probability review
01 Probability review
 
05 probabilistic graphical models
05 probabilistic graphical models05 probabilistic graphical models
05 probabilistic graphical models
 
老師與教學助理的互動經驗分享 1010217
老師與教學助理的互動經驗分享 1010217老師與教學助理的互動經驗分享 1010217
老師與教學助理的互動經驗分享 1010217
 
Introduction Pp 1
Introduction Pp 1Introduction Pp 1
Introduction Pp 1
 
Nac tech test benefits presentation
Nac tech test benefits presentationNac tech test benefits presentation
Nac tech test benefits presentation
 
Markov Random Field (MRF)
Markov Random Field (MRF)Markov Random Field (MRF)
Markov Random Field (MRF)
 

Similar to Bayesian Networks Unit 3: Discrete Uncertainty Inference

Characterizing the Heterogeneity of 2D Materials with Transmission Electron M...
Characterizing the Heterogeneity of 2D Materials with Transmission Electron M...Characterizing the Heterogeneity of 2D Materials with Transmission Electron M...
Characterizing the Heterogeneity of 2D Materials with Transmission Electron M...University of Illinois at Urbana-Champaign
 
Neuroimaging: Intracortical, fMRI, EEG
Neuroimaging: Intracortical, fMRI, EEGNeuroimaging: Intracortical, fMRI, EEG
Neuroimaging: Intracortical, fMRI, EEGIlya Kuzovkin
 
A review on power quality disturbance classification using deep learning appr...
A review on power quality disturbance classification using deep learning appr...A review on power quality disturbance classification using deep learning appr...
A review on power quality disturbance classification using deep learning appr...MuskanRath1
 
Yanjun Chen_1017_English Version
Yanjun Chen_1017_English VersionYanjun Chen_1017_English Version
Yanjun Chen_1017_English VersionYanjun Chen
 
Eran Gur CV 2015
Eran Gur CV 2015Eran Gur CV 2015
Eran Gur CV 2015Eran Gur
 
Exploring didactic possibilities of an electronic devices remote lab with stu...
Exploring didactic possibilities of an electronic devices remote lab with stu...Exploring didactic possibilities of an electronic devices remote lab with stu...
Exploring didactic possibilities of an electronic devices remote lab with stu...Federico Lerro
 
Auto Configuring Artificial Neural Paper Presentation
Auto Configuring Artificial Neural Paper PresentationAuto Configuring Artificial Neural Paper Presentation
Auto Configuring Artificial Neural Paper Presentationguestac67362
 
Subspace Identification
Subspace IdentificationSubspace Identification
Subspace Identificationaileencv
 
Feasibility of moment tensor inversion for a single-well microseismic data us...
Feasibility of moment tensor inversion for a single-well microseismic data us...Feasibility of moment tensor inversion for a single-well microseismic data us...
Feasibility of moment tensor inversion for a single-well microseismic data us...Oleg Ovcharenko
 

Similar to Bayesian Networks Unit 3: Discrete Uncertainty Inference (20)

02 Statistics review
02 Statistics review02 Statistics review
02 Statistics review
 
08 probabilistic inference over time
08 probabilistic inference over time08 probabilistic inference over time
08 probabilistic inference over time
 
04 Uncertainty inference(continuous)
04 Uncertainty inference(continuous)04 Uncertainty inference(continuous)
04 Uncertainty inference(continuous)
 
07 approximate inference in bn
07 approximate inference in bn07 approximate inference in bn
07 approximate inference in bn
 
Monocular Human Pose Estimation with Bayesian Networks
Monocular Human Pose Estimation with Bayesian NetworksMonocular Human Pose Estimation with Bayesian Networks
Monocular Human Pose Estimation with Bayesian Networks
 
Towards Embedded Computer Vision - New @ 2013
Towards Embedded Computer Vision - New @ 2013Towards Embedded Computer Vision - New @ 2013
Towards Embedded Computer Vision - New @ 2013
 
Characterizing the Heterogeneity of 2D Materials with Transmission Electron M...
Characterizing the Heterogeneity of 2D Materials with Transmission Electron M...Characterizing the Heterogeneity of 2D Materials with Transmission Electron M...
Characterizing the Heterogeneity of 2D Materials with Transmission Electron M...
 
06 exact inference in bn
06 exact inference in bn06 exact inference in bn
06 exact inference in bn
 
Neuroimaging: Intracortical, fMRI, EEG
Neuroimaging: Intracortical, fMRI, EEGNeuroimaging: Intracortical, fMRI, EEG
Neuroimaging: Intracortical, fMRI, EEG
 
Ppt on ndt by rohit no 67
Ppt on ndt by rohit no 67Ppt on ndt by rohit no 67
Ppt on ndt by rohit no 67
 
A review on power quality disturbance classification using deep learning appr...
A review on power quality disturbance classification using deep learning appr...A review on power quality disturbance classification using deep learning appr...
A review on power quality disturbance classification using deep learning appr...
 
JingLi_Resume
JingLi_ResumeJingLi_Resume
JingLi_Resume
 
Yanjun Chen_1017_English Version
Yanjun Chen_1017_English VersionYanjun Chen_1017_English Version
Yanjun Chen_1017_English Version
 
Eran Gur CV 2015
Eran Gur CV 2015Eran Gur CV 2015
Eran Gur CV 2015
 
Exploring didactic possibilities of an electronic devices remote lab with stu...
Exploring didactic possibilities of an electronic devices remote lab with stu...Exploring didactic possibilities of an electronic devices remote lab with stu...
Exploring didactic possibilities of an electronic devices remote lab with stu...
 
Auto Configuring Artificial Neural Paper Presentation
Auto Configuring Artificial Neural Paper PresentationAuto Configuring Artificial Neural Paper Presentation
Auto Configuring Artificial Neural Paper Presentation
 
Farag- Resume
Farag- ResumeFarag- Resume
Farag- Resume
 
Subspace Identification
Subspace IdentificationSubspace Identification
Subspace Identification
 
Feasibility of moment tensor inversion for a single-well microseismic data us...
Feasibility of moment tensor inversion for a single-well microseismic data us...Feasibility of moment tensor inversion for a single-well microseismic data us...
Feasibility of moment tensor inversion for a single-well microseismic data us...
 
Towards Embedded Computer Vision邁向嵌入式電腦視覺
Towards Embedded Computer Vision邁向嵌入式電腦視覺Towards Embedded Computer Vision邁向嵌入式電腦視覺
Towards Embedded Computer Vision邁向嵌入式電腦視覺
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 

Bayesian Networks Unit 3: Discrete Uncertainty Inference

  • 1. 1 Bayesian Networks Unit 3 Uncertainty Inference:Discrete Wang, Yuan-Kai, 王元凱 ykwang@mails.fju.edu.tw http://www.ykwang.tw Department of Electrical Engineering, Fu Jen Univ. 輔仁大學電機工程系 2006~2011 Reference this document as: Wang, Yuan-Kai, “Uncertainty Inference - Discrete," Lecture Notes of Wang, Yuan-Kai, Fu Jen University, Taiwan, 2011. Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 2. 王元凱 Unit - Uncertainty Inference (Discrete) p. Goal of this Unit • Review advanced concepts of statistics – Statistical Inference – Pattern recognition 2 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 3. 王元凱 Unit - Uncertainty Inference (Discrete) p. Related Units • Previous unit(s) – Probability Review – Statistics Review • Next units – Uncertainty Inference (Continuous) 3 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 4. 王元凱 Unit - Uncertainty Inference (Discrete) p. Self-Study • Artificial Intelligence: a modern approach – Russell & Norvig, 2nd, Prentice Hall, 2003. pp.462~474, – Chapter 13, Sec. 13.1~13.3 • 統計學的世界 – 墨爾著,鄭惟厚譯, 天下文化,2002 • 深入淺出統計學 – D. Grifiths, 楊仁和譯,2009, O’ Reilly 4 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 5. 王元凱 Unit - Uncertainty Inference (Discrete) p. 5 Contents 1. Acting Under Uncertainty …………………. 6 2. Basic Probability ..................………..……. 15 3. Marginal Probability ..…….......................... 27 4. Inference Using Full Joint Distribution ... 30 5. Independence ............................................ 43 6. Bayes' Rule and Its Use ............................ 47 7. Summary ……………………………………. 62 5 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 6. 王元凱 Unit - Uncertainty Inference (Discrete) p. 6 1. Acting Under Uncertainty sensors ? ? environment agent ? actuators model Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 7. 王元凱 Unit - Uncertainty Inference (Discrete) p. 7 Example 1-Localization (1/3) • Where is it – It is a robot – Sensor: camera, laser range finder, sonar – State: (x, y, orientation), Prob. Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 8. 王元凱 Unit - Uncertainty Inference (Discrete) p. 8 Example 1-Localization (2/3) • Where is it – It is a mobile station/robot – Sensor: Wireless LAN – State: (x, y), Prob. Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 9. 王元凱 Unit - Uncertainty Inference (Discrete) p. 9 Example 1-Localization (3/3) • Where is it – It is a moving text – Sensor: computer vision techniques – State: (x, y, moving direction), Prob. t-3 t-2 t-1 t Output t Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 10. 王元凱 Unit - Uncertainty Inference (Discrete) p. 10 Example 2-Correlation of Features and Words of Color • Word of color • Feature of color (Average) RGB=(255,0,0) – Red RGB=(220,10,10) RGB=(223,0,0) Uncertainty RGB=(180,20,20) – Light red RGB=(150,30,30) RGB=(147,25,25) ... Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 11. 王元凱 Unit - Uncertainty Inference (Discrete) p. 11 Example 3-Target Tracking for Robot • The robot must keep the target in view • The target’s trajectory is not known in advance target robot • The environment may or may not be known Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 12. 王元凱 Unit - Uncertainty Inference (Discrete) p. 12 Inaccuracy & Uncertainty  Sensor Inaccuracy • Movement Inaccuracy  Environmental Uncertainty Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 13. 王元凱 Unit - Uncertainty Inference (Discrete) p. 13 Degree of Belief • Probability theory – Assigns a numerical degree of belief between 0 and 1 to an evidence – Provides a way of summarizing the uncertainty Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 14. 王元凱 Unit - Uncertainty Inference (Discrete) p. 14 Techniques for Uncertainty • Bayes rule/Bayesian network with probability theory • Certainty factor in expert system • Fuzzy theory with possibility theory • Dempster-Shafer theory Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 15. 王元凱 Unit - Uncertainty Inference (Discrete) p. 15 2. Basic Probability • Terms – Random variables – Full joint distribution (FJD) – Conditional probability table (CPT) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 16. 王元凱 Unit - Uncertainty Inference (Discrete) p. 16 Random Variable • Boolean random variable – Rain : true, false • Discrete random variable – Rain: cloudy, sunny, drizzle, drench • Continuous random variable – Rain: rainfall in millimeter We will focus on Boolean & discrete cases in most examples of this book Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 17. 王元凱 Unit - Uncertainty Inference (Discrete) p. 17 For Boolean & Discrete R.V. • P(X) is a vector • Boolean R.V. – Rain: true, false – P(Rain) = <0.72, 0.28> • Discrete R.V. – Rain: cloudy, sunny, drizzle, drench – P(Rain) = <0.72, 0.1, 0.08, 0.1> – Normalized, i.e. sums to 1 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 18. 王元凱 Unit - Uncertainty Inference (Discrete) p. 18 Full Joint Distribution (1/3) • For a set of random variables { X1 , X2 ,  , Xn } • X1  X2    Xn are atomic events • P(X1  X2    Xn) is – A full joint probability distribution – A table of all joint prob. of all atomic events, if {X1,  , Xn} are discrete • All questions about probability of joint events can be answered by the table Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 19. 王元凱 Unit - Uncertainty Inference (Discrete) p. 19 Full Joint Distribution (2/3) • Ex: X1: Rain, X2: Wind – X1: drizzle, drench, cloudy, – X2: strong, weak – X1  X2 are atomic events – P(X1  X2) is a 3x2 matrix of values Rain Drizzle Drench Cloudy Wind Strong 0.15 0.12 0.06 Weak 0.55 0.08 0.04 P(X1=drizzle  X2=strong) = 0.15, ... Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 20. 王元凱 Unit - Uncertainty Inference (Discrete) p. 20 Full Joint Distribution (3/3) • All questions about probability of joint events can be answered by the table – P(Wind=Strong), P(Rain=Drizzle  Wind=Strong), ... Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 21. 王元凱 Unit - Uncertainty Inference (Discrete) p. 21 Posterior v.s. Prior Probabilities • P(Cavity|Toothache) – Conditional probability – Posterior probability (after the fact/evidence) • P(Cavity) – Prior probability (the fact) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 22. 王元凱 Unit - Uncertainty Inference (Discrete) p. 22 An Example (1/2) • For a dental diagnosis – Let {Cavity,Toothache} be a set of Boolean random variables • Denotations for Boolean R.V. – P(Cavity=true) = P(cavity) – P(Cavity=false) = P(cavity) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 23. 王元凱 Unit - Uncertainty Inference (Discrete) p. 23 An Example (2/2) • The full joint probability distribution P(Toothache  Cavity) toothache toothache cavity 0.04 0.06 cavity 0.01 0.89 P(cavity  toothache)  0.04  0.01  0.06  0.11 P (cavity | toothache) P (cavity  toothache) 0.04    0.80 P (toothache) 0.04  0.01 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 24. 王元凱 Unit - Uncertainty Inference (Discrete) p. 24 Conditional Probability (Math) • P(X1=x1i| X2 =x2j) is a conditional probability • P(X1 | X2) is a conditional distribution function – All P(X1=x1i| X2 =x2j) for all possible i, j • For Boolean & discrete R.V.s, conditional distribution function is a table – Conditional distribution of continuous R.V. will not used in our discussions Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 25. 王元凱 Unit - Uncertainty Inference (Discrete) p. 25 Conditional Probability Table (CPT) • For the dental diagnosis problem, – Toothache & Cavity are Boolean R.V.s – P(Toothache|Cavity) is a CPT Cavity P(toothache|Cavity) P(toothache|Cavity) T 0.90 0.1 F 0.05 0.95 Cavity P(toothache|Cavity) T 0.90 F 0.05 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 26. 王元凱 Unit - Uncertainty Inference (Discrete) p. 26 CPT v.s. FJD toothache toothache cavity 0.04 0.06 cavity 0.01 0.89 Sum of all atomic events = 1 Cavity P(toothache|Cavity) P(toothache|Cavity) T 0.90 0.1 F 0.05 0.95 Sum of a row = 1 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 27. 王元凱 Unit - Uncertainty Inference (Discrete) p. 27 3. Marginal Probability P( X i )   P(e ) e j E ( X i ) j Marginal probability • Probability of a random variable is the sum of the probabilities of the atomic events containing the random variable • Marginalization (summing out) P(toothache) toothache toothache =P(toothache  cavity)+ cavity 0.04 0.06 P(toothache  cavity) cavity 0.01 0.89 =0.04 + 0.01 = 0.05 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 28. 王元凱 Unit - Uncertainty Inference (Discrete) p. 28 Marginal Probability (1/2) • Suppose a problem of a world contains only 3 random variables {X1, X2, X3}  P( X 1  X2  X3) 1 P( X 1  X 2 )   P( X x3 X 3 1  X 2  X 3  x3 ) P( X1  x1  X2  x2 )  P( X1  x1  X2  x2  X3  x3 ) x3X3 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 29. 王元凱 Unit - Uncertainty Inference (Discrete) p. 29 Marginal Probability (2/2) • Using higher order joint probability to calculate marginal and other lower order joint probability P( X 1  x1 )   P( X x 2  X 2 1  x1  X 2  x2 )    P( X x 2  X 2 x3 X 3 1  x1  X 2  x2  X 3  x3 ) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 30. 王元凱 Unit - Uncertainty Inference (Discrete) p. 30 4. Inference Using Full Joint Distributions • Probabilistic inference – Uses the full joint distribution as the "knowledge base" – Is the computation from observed evidence of posterior probabilities for query • Compute conditional probability • The most simple inference method: Inference by enumeration Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 31. 王元凱 Unit - Uncertainty Inference (Discrete) p. 31 The Dental Diagnosis Example • The set of random variables: Toothache, Cavity, and Catch – All are Boolean random variables – Note: P(toothache)  P(Toothache=true) • The full joint distribution is a 2x2x2 table Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 32. 王元凱 Unit - Uncertainty Inference (Discrete) p. 32 The Full Joint Distribution • 8 atomic events (sum=1) – P(toothachecatch cavity)=0.108 – P(toothachecatch cavity)=0.16 – P(toothachecatch cavity)=0.012 – P(toothachecatch cavity)=0.064 – ... Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 33. 王元凱 Unit - Uncertainty Inference (Discrete) p. 33 Inference by Enumeration • P(cavity|toothache) P(cavity  toothache)  P(toothache) • We can answer the query by –Enumerating P(cavitytoothache) from the full joint distribution –Enumerating P(toothache) from the full joint distribution Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 34. 王元凱 Unit - Uncertainty Inference (Discrete) p. 34 Joint Probability • P(cavity  toothache) Order-2 joint = 0.016+0.064 = 0.08 probability Marginal probability Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 35. 王元凱 Unit - Uncertainty Inference (Discrete) p. 35 Marginal Probability • P(toothache) = 0.108+0.012+0.016+0.064 = 0.2 Marginal probability of Toothache Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 36. 王元凱 Unit - Uncertainty Inference (Discrete) p. 36 Conditional Probability • P(cavity|toothache) P (cavity  toothache) 0.08    0 .4 P (toothache) 0.2 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 37. 王元凱 Unit - Uncertainty Inference (Discrete) p. 37 An Exercise • P(cavity  toothache)  P(Cavity=true  Toothache=true) = 0.108+0.012+0.072+0.008+0.016+0.064 = 0.28 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 38. 王元凱 Unit - Uncertainty Inference (Discrete) p. 38 Normalization (1/2) • P(cavity|toothache) and P(cavity|toothache) have the same denominator P(toothache) P(cavity  toothache) P(cavity | tootheache)  P(toothache) P(cavity  toothache) P(cavity | tootheache)  P(toothache) • 1/P(toothache) can be viewed as a normalization constant for probability calculation and derivation Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 39. 王元凱 Unit - Uncertainty Inference (Discrete) p. 39 Normalization (2/2) • P(cavity|toothache) =  P(cavitytoothache) • P(cavity|toothache) =  P(cavitytoothache) =  [ P(cavitytoothache  catch) + P(cavitytoothache  catch) ] =  [ 0.108 + 0.012 ] =   0.12 = 0.6 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 40. 王元凱 Unit - Uncertainty Inference (Discrete) p. 40 A General Inference Procedure (1/2) • Let P(X|E=e) be the query – X be the query variable – E be the set of evidence variables – e be the observed values of E – H be the remaining unobserved variables (Hidden variables) • Inference of the query P(X|E=e) is P ( X | E  e)  P ( X  E  e ) 1    P ( X  E  e  H  h) 2 hH Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 41. 王元凱 Unit - Uncertainty Inference (Discrete) p. 41 A General Inference Procedure (2/2) • E.x.: Query P(cavity|toothache) – X: Cavity, E/e: Toothache/true, H: Catch P (cavity | toothache ) P ( X | E  e)  P(cavity  toothache)  P ( X  E  e)   [ P(cavity  toothache  catch )    P( X  E  e  H  h)  P (cavity  toothache  catch )] hH Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 42. 王元凱 Unit - Uncertainty Inference (Discrete) p. 42 Complexity of the Enumeration-based Inference Algorithm • For n Boolean R.V.s – Space complexity: O(2n) (Store the full joint distribution) – Time complexity: O(2n) (worst case) • For n discrete R.V.s, all have d discrete values – Time complexity: O(dn) (worst case) – Space complexity: O(dn) • It is not a practical algorithm, • More efficient algorithm is needed Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 43. 王元凱 Unit - Uncertainty Inference (Discrete) p. 43 5. Independence • A and B are independent iff – P(A|B) = P(A), or – P(B|A) = P(B), or – P(AB) = P(A)P(B) A B  Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 44. 王元凱 Unit - Uncertainty Inference (Discrete) p. 44 The Dental Diagnosis Example (1/2) • Original example: 3 random variables • Add a fourth variable: Weather – The Weather variable has 4 values – The full joint distribution: P(Toothache,Catch,Cavity,Weather) has 32 elements (2x2x2x4) • By commonsense, Weather is independent of the original 3 variables – P(ToothacheCatch  Cavity  Weather) = P(Toothache  Catch  Cavity)P(Weather) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 45. 王元凱 Unit - Uncertainty Inference (Discrete) p. 45 The Dental Diagnosis Example (2/2) • P(Toothache,Catch,Cavity,Weather) = P(Toothache,Catch,Cavity)P(Weather) – The 32-element table for 4 variables can be constructed from • One 8-element table, and • One 4-element table – Reduced from 32 elements to 12 elements Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 46. 王元凱 Unit - Uncertainty Inference (Discrete) p. 46 Advantages of Independence • Independence can dramatically reduce the amount of elements of the full distribution table – i.e., independence can help in reducing • The size of the domain representation, and • The complexity of the inference problem • Independence are usually based on knowledge of the domain Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 47. 王元凱 Unit - Uncertainty Inference (Discrete) p. 47 6. Bayes' Rule and Its Use • Given two random variables X, Y • By product rule P( X  Y )  P( X | Y )P(Y ) P( X  Y )  P(Y | X )P( X ) P( X | Y ) P(Y )  P(Y | X )  P( X ) • Bayes' rule underlies all modern AI systems for probabilistic inference Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 48. 王元凱 Unit - Uncertainty Inference (Discrete) p. 48 Bayes’ Theorem Likelihood Prior P (e / h ) P ( h ) P (h / e)  P (e) Posterior Probability of Evidence Probability of an hypothesis, h, can be updated when evidence, e, has been obtained. Note: it is usually not necessary to calculate P(e) directly as it can be obtained by normalizing the posterior probabilities, P(hi | e). Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 49. 王元凱 Unit - Uncertainty Inference (Discrete) p. 49 A Simple Example Consider two related variables: 1. Drug (D) with values y or n 2. Test (T) with values +ve or –ve And suppose we have the following probabilities: P(D = y) = 0.001 P(T = +ve | D = y) = 0.8 P(T = +ve | D = n) = 0.01 These probabilities are sufficient to define a joint probability distribution. Suppose an athlete tests positive. What is the probability that he has taken the drug? P (T   ve | D  y ) P ( D  y ) P(D  y|T   ve)  P (T   ve | D  y ) P ( D  y )  P (T   ve | D  n ) P ( D  n ) 0.8  0.001  0.8  0.001  0.01  0.999  0.074 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 50. 王元凱 Unit - Uncertainty Inference (Discrete) p. 50 A More Complex Case Suppose now that there is a similar link between Lung Cancer (L) and a chest X- ray (X) and that we also have the following relationships: History of smoking (S) has a direct influence on bronchitis (B) and lung cancer (L); L and B have a direct influence on fatigue (F). What is the probability that someone has bronchitis given that they smoke, have  P(b , s f , x , l ) fatigue and have received a positive X-ray result? 1 1 1 1 P(b , s , f , x ) P(b | s , f , x )  1  1 1 1 l  P(b, s , f , x , l ) 1 1 1 1 P( s , f , x ) 1 1 1 1 1 1 b ,l where, for example, the variable B takes on values b1 (has bronchitis) and b2 (does not have bronchitis). R.E. Neapolitan, Learning Bayesian Networks (2004) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 51. 王元凱 Unit - Uncertainty Inference (Discrete) p. 51 An Example • Prior knowledge – The probability of a patient has meningitis is 1/50,000: P(m)=1/50000 – The probability of a patient has stiff neck is 1/20: P(s)=1/20 – The meningitis causes the patient to have a stiff neck 50% of the time: P(s|m)=0.5 • The probability of a stiff-neck patient has meningitis P(s | m)P(m) 0.51/ 50000 P(m | s)    0.0002 P(s) 1/ 20 Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 52. 王元凱 Unit - Uncertainty Inference (Discrete) p. 52 Generalization of Bayes’ Rule • Conditionalized on more evidences, say e P ( X | Y , e) P (Y | e) P(Y | X , e)  P ( X | e) • P(Cavity|toothachecatch) = (P(toothachecatch|Cavity)P(Cavity)) / P(toothachecatch) => P(toothache  catch  Cavity) / P(toothachecatch) Better way? Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 53. 王元凱 Unit - Uncertainty Inference (Discrete) p. 53 Use Independence in Conditional (1/2) • Probe Catch and Toothache are independent, given the presence or the absence of a Cavity – Both Catch and Toothache are caused by Cavity, but neither has a direct effect on the other • P(toothachecatch|Cavity) = P(toothache|Cavity) P(catch|Cavity) • Conditional independence Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 54. 王元凱 Unit - Uncertainty Inference (Discrete) p. 54 Use Independence in Conditional (2/2) • If Catch is conditionally independent of Toothache given Cavity • Equivalent statements – P(Catch  Toothache|Cavity) =P(Catch|Cavity) P(Toothache|Cavity) – P(Catch|ToothacheCavity) =P(Catch|Cavity) – P(Toothache|CatchCavity) =P(Toothache|Cavity) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 55. 王元凱 Unit - Uncertainty Inference (Discrete) p. 55 Conditional Independency for the Dentist Diagnosis Problem (1/2) • The conditional independence, like independence, can also decompose the full joint distribution into smaller pieces • P(Toothache  Catch  Cavity) • = P(Toothache  Catch|Cavity)P(Cavity) (by product rule) • = P(Toothache|Cavity) P(Catch|Cavity) P(Cavity) (by definition of conditional independence) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 56. 王元凱 Unit - Uncertainty Inference (Discrete) p. 56 Conditional Independency for the Dentist Diagnosis Problem (2/2) • P(Toothache  Catch  Cavity) has 23-1 elements • P(Toothache|Cavity)P(Catch|Cavity)P(Cavity) has 2+2+1=5 elements P(toothache|Cavity) P(toothache|Cavity) cavity 0.9 0.1 cavity 0.05 0.95 Conditional Probability Table (CPT) • Conditional independence can reduce the amount of probabilities Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 57. 王元凱 Unit - Uncertainty Inference (Discrete) p. 57 Probabilistic Modeling of Problems (1/2) • Usually random variables have two semantics – Cause – Effect • Conditional probability P(Y|X) can be rewritten as P(Cause|Effect) or P(Effect|Cause) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 58. 王元凱 Unit - Uncertainty Inference (Discrete) p. 58 Probabilistic Modeling of Problems (2/2) • We usually assume some effects are conditionally independent given a cause – P(effect1  effect2 | cause) = P(effect1 | cause) P(effect2 | cause) The conditional independence can be drawn as a graphic model Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 59. 王元凱 Unit - Uncertainty Inference (Discrete) p. 59 Advantages of Conditional Independence • The use of conditional independence reduces the size of the joint distribution from O(2n) to O(n) • Conditional independence is our most basic and robust form of knowledge about uncertain environments Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 60. 王元凱 Unit - Uncertainty Inference (Discrete) p. 60 Conditional Independence (Math) • If P(Xi|Xj,X)=P(Xi|X), we say that variable Xi is conditional independent of Xj, given X – Denoted as I(Xi,Xj|X) – It means for Xi, if we know X, we can ignore Xj • If I(Xi,Xj|X), P(Xi,Xj|X) = P(Xi|X) P(Xj|X) – By chain rule, P(Xi,Xj|X) = P(Xi|Xj,X) p(Xj|X) – Since p(Xi|Xj,X)=p(Xi|X), – Then p(Xi,Xj|X)= p(Xi|X) p(Xj|X) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 61. 王元凱 Unit - Uncertainty Inference (Discrete) p. 61 Pairwise Independence • A generalization of pairwise independence – We say that the variables X1, …, Xn are mutually conditionally independent, given a n set X p( X 1 , X 2 , X n | X )   p( X i | X ) Why? i 1 n By chain rule P( X 1 , X 2 ,, X n )   P( X i | X i 1 ,, X 1 ) n i 1  P( X 1 , X 2 ,  , X n | X )   P( X i | X i 1 ,  , X 1 , X ) i 1 Since Xi is conditional independent of the others given X n  p( X 1 , X 2 , X n | X )   p( X i | X ) i 1 When X is empty, we have p(X1,X2, …,Xn)=p(X1)p(X2)…p(Xn) Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright
  • 62. 王元凱 Unit - Uncertainty Inference (Discrete) p. 62 7. Summary • The full joint distribution can answer any query of the domain – However, it is intractable • Independence and conditional independence is important for the reduction of the full joint distribution • We can now move on to Bayesian networks Fu Jen University Department of Electrical Engineering Wang, Yuan-Kai Copyright