Conditional probability distribution

Until now, we have only discussed computing the marginal probability of the form P(Y= y) over variables, but in the real world, we are mostly working with conditional probability distributions rather than marginal distributions. Now, with sampling methods, we have multiple ways of approaching the problem of conditional distributions, but all of them turn out to be significantly harder than computing marginals.

Let's say we want to compute the probability of P(y|E = e). The first approach that we can think of is to generate particles normally from the distribution and then reject the samples that don't satisfy the condition E = e. This method is known as rejection sampling. However, with this method, we will ...

Get Mastering Probabilistic Graphical Models Using Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.