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

MAP using variable elimination


Let's start with a very basic example of a network A -> B, as shown in the following figure:

Fig 3.13: Basic Bayesian network with two variables

For MAP, we want to compute the following:

If we consider any particular assignment a for the variable A, we have the following:

So, for any given assignment of A, we have to select the assignment of B for which P(b|a) is at maximum. We also have to select the maximum assignment of B as any given assignment of A doesn't guarantee that it would be the global maximum. Therefore, we need to check the values for each assignment of A.

Now, let's try to find the MAP assignment for the network in the Fig 3.13. Assuming the assignment from A to , let's define and similarly, . Now, let's compute the max-marginal over A: