Book Image

Mastering Probabilistic Graphical Models with Python

By : Ankur Ankan
Book Image

Mastering Probabilistic Graphical Models with Python

By: Ankur Ankan

Overview of this book

Table of Contents (14 chapters)
Mastering Probabilistic Graphical Models Using Python
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Importance sampling in Bayesian networks


In this section, we will apply the concept of importance sampling in Bayesian networks. We will discuss the proposal distribution Q, which we usually use in the case of Bayesian networks.

Assume that in a Bayesian network, we want to focus our samples to a particular set of events Z = z, either because we want the probability of Z or we have observed Z. Taking the example of our restaurant model, let's say we have observed that the cost is high. It is easy for us to sample the descendant variables of Cost according to this condition. However, it is not possible for us to sample the nondescendant variables without performing inference over them.

So now, we define a distribution that simplifies the generation of particles. This new distribution is known as mutilated network proposal distribution. Let's say, given a network B and some conditions Z = z, we define the mutilated network as follows:

  • Each node has no parents in , and the CPDs of all give...