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

The Bayesian score for Bayesian networks


In the preceding section, we discussed computing the Bayesian score in the case of single random variables. In this section, we will generalize our discussion to compute the Bayesian score for Bayesian networks. Again, we will take the case of having two random variables, X and Y, and two possible network structures over them. We will denote the structure with no edges between X and Y with and the network with .

For , we have the following equation:

Assuming that the parameters are independent, we have the following equation:

In the preceding equation, we can see that we have a marginal likelihood for each of the variables, X and Y. Now, if both of these variables are multinomial and have a Dirichlet prior, we can write each of these terms in the form of the equation that we discussed in the preceding section.

Now, let's consider the case of . Again, assuming parameter independence, we can decompose the integral as follows:

Now, let's compare the marginal...