O'Reilly logo

Building Probabilistic Graphical Models with Python by Kiran R Karkera

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sampling-based methods

We will now proceed to examine another approach to perform approximate inference.

In sampling-based methods, we use samples drawn from the distribution to estimate statistics from the overall distribution. The samples drawn are independent and identically distributed.

In the chapter on parameter estimation, we have drawn samples from the posterior distribution to estimate the probabilities of a CPD using methods such as maximum likelihood and Bayesian approaches.

In this section, we will learn to sample from a Bayesian network, which is slightly different from sampling a distribution.

Forward sampling

A sampling method that uses the topological ordering of a Bayes network is called forward sampling. A topological ordering in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required