Exact Inference in Bayesian Networks: Probabilistic Query and Variable Elimination

lecture notes for principles of artificial n.w
1 / 14
Embed
Share

Learn about exact algorithms for posterior probability computation in Bayesian networks through probabilistic queries, variable elimination, and inference techniques such as enumeration and variable ordering. Explore examples and expression trees to understand computations and algorithmic strategies in artificial intelligence.

  • Bayesian Networks
  • Probabilistic Query
  • Variable Elimination
  • Artificial Intelligence
  • Inference Techniques

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Lecture notes for Principles of Artificial Intelligence (COMS 4720/5720) Yan-Bin Jia, Iowa State University Exact Inference in Bayesian Networks Outline I. Probabilistic query using a BN II. Variable Elimination III. Variable ordering and relevance * Figures are from the textbook site.

  2. II. Probabilistic Query ?: query variable ? = {?1, .??}: evidence variables ? = {?1, .??}: an observed event ? = {?1, .??}: hidden variables {?} ? ? Complete variable set: Query ? ? ?)? // ? Burglary ?,?) ? BurglaryJohnCalls = true,MaryCalls = true) = 0.284,0.716 We will discuss exact algorithms for posterior probability computation.

  3. Inference by Enumeration ? ?,? = ? ? ?)?(?) Vector Scalar Vector of evidences ? ? ?) = ?? ?,? = ? ?(?,?,?) ? ? ? ??parents(??)) ?(?1, ,??) = ?=1 computable as products of conditional probabilities from the BN. Answer the query ? ? ?) using a BN.

  4. Burglary Example (revisited) ? BurglaryJohnCalls = true,MaryCalls = true)? Hidden variables: ? = {Earthquake,Alarm} ?(?,?,?,? ,? ) ? ? ?,?) = ?? ?,?,? = ? ? {?, ?} ? {?, ?} // the textbook uses ?, ? in the summation. this is incorrect // because ? is a constant value standing for // Earthquake = true.? cannot be overloaded. the index // variable ? can take on both ? and ? needed for the // summation. meanwhile, we cannot use ? here because // then we would be computing the joint distribution of ? and ?. evaluated for ? (Burglary = true) based on ? ? ??parents(??)) ?(?1, ,??) = ?=1 ? ? ? ? ? ? ?,? )? ? ? )? ? ? ) ? ? ?,?) = ? ? ? In the general case with ? hidden variables, there are 2? summands, each as a product requires ?(?) computation time.

  5. Expression Tree Take advantage of the nested structure to move summations inwards as far as possible. ? ? ?,?) = ?? ? ? ? ? ? ?,? )? ? ? )? ? ? ) ? // these values, not ? ? ? ? ? ? ? ?,? )? ? ? )? ? ? ) ? ? ?,?) = ? // those in the table // next to Alarm in // Fig. 13.2, match the // values in the tree on // the right. ? ? Multiply values along each path. Sum at the + nodes. ? ? ?,?) = ? 0.00059224 ? ? ?,?) = ? 0.0014919 (computed using a tree of the same structure but with ? replaced by ? and probabilities changed) ? ? ?,?) = ? 0.00059224,0.0014919 0.284,0.716

  6. Enumeration Algorithm Depth-first recursion ?(2?) time for ? variables Repeated evaluations of the same subexpressions

  7. III. Variable Elimination Idea Do the calculation once and save the results for later use (like dynamic programming). Evaluate an expression from right to left (i.e., bottom up in the expression tree). ? ? ? ? ?,? )? ? ? )? ? ? ) ? ? ?,?) = ?? ? ? ? ? ? ? ? ?,? )? ? ? )? ? ? ) ? ? ?,?) = ?? ? ? ? factors: ?1(?) ?5(?) ?2(?) ?3(?,?,?) ?4(?) dimensions: // distribution now denoted as // a column vector or, for // compactness, a tensor (i.e., // a multi-dimensional array). 2 1 2 1 2 1 2 2 2 2 1 2 1 ? ? ?) ? ? ?) ? ? ?) ? ? ?) 0.70 0.01 0.90 0.05 ?5? = = ?4? = =

  8. Evaluation Example Pointwise product operation ??(? ) ??(? ,?,? ) ??(? ) ??(? ) ? ? ?,?) = ???(?) ? ? ?6(?,? ) Sum out ? from the product of ?3,?4,?5. ?6?,? = ? {?, ?} 2 2 ??(? ,?,? ) ??(? ) ??(? ) = ?3?,?,? ? ? | ? ? ? | ? 2 2 + ?3 ?,?,? ? ? | ? ? ? | ? 2 2 ?2(? ) ?6?,? ? ? ?,?) = ???(?) ? ?7(?,? ) Sum out ? from the product of ?2 and ?6. ?7? = ? {?, ?} Finally, carry out the following pointwise product: ? ? ?,?) = ???(?) ??(?) 2 1 2 1 2 1 ??(? ) ??(?,? ) = ? ? ?6?,? + ?( ?) ?6(?, ?) 2 1 2 1 2 1

  9. Pointwise Product of Two Factors ?(?1, ,??,?1, ,??) ?(?1, ,??,?1, ,??) = ?(?1, ,??,?1, ,??, ?1, ,??) common variables Entries under ?(?,?), ?(?,?), and ?(?,?,?) do not represent probabilities.

  10. Summing Out a Variable This operation over a product of factors is carried out by adding up the submatrices, each for one value of the same variable. ?(? ,?,?) = ? ?,?,? + ?( ?,?,?) ? ?,? = ? {?, ?} .06 .42 .24 .28 +.18 .72 .04 .24 .48 .96 .32 = = .06 // Entries are just for illustration; // they are not probabilities.

  11. Variable Elimination Algorithm Move outside the summation any factor independent of the variable to be summed out. ? ? ,? ? ?,? = ?(?,?) ?(? ,?) ? ?

  12. IV. Ordering Variables to Eliminate ? Every choice of ordering yields a valid algorithm. ? ??parents(??)) ?(?1, ,??) = ?=1 (Order: ?,?) ??(? ) ??(? ,?,? ) ??(? ) ??(? ) ? ? ?,?) = ???(?) ? ? (Order: ?,?) ??(? ) ??? ??? ??(? ,?,? ) ? ? ?,?) = ???(?) ? ? Different orderings generates different intermediate factors. Time and space are dominated by the size of the largest factor constructed, which is subject to two factors: ordering of variables structure of the network It is intractable to determine the optimal order. Use a greedy heuristic: eliminate whichever variable minimizes the size of the next factor to be constructed.

  13. Irrelevant Variable ? JohnCallsBurglary = true)? ?(? ) ? ? ?,? ) ? ? ? ) ? ? ? ) ? ? ?) = ??(?) ? ? ? ? ? ? ) = 1 ? ?, ? The eliminated variable ? is irrelevant to the query. This cannot be inferred using the Markov blanket or d-separation. M is not in the Markov blanket {?} of J. But neither is B. (Given ?, ? & ? would be irrelevant.) J and M are not d-separated by B. (The moral graph would contain the network plus an edge connecting Band E.)

  14. Inference with Elimination We can remove a leaf node (e.g., ?) that is neither a query variable nor an evidence variable. ? JohnCallsBurglary = true)? After the removal, there may be more leaf nodes that are irrelevant. Remove them as well, and so on. Every variable that is not an ancestor of a query variable or evidence variable is irrelevant to the query. Using reverse topological order for variables, exact inference with elimination can be 1,000 times faster than the enumeration algorithm. If we want to compute posterior probabilities for all the variables rather than answer individual queries, we can use clustering algorithms (i.e., join tree algorithms).

More Related Content