A marginal probability describes one variable without conditioning on another. Obtain it from a joint distribution by summing over the other variable, or integrating it for continuous variables. section 2.1.3 section 2.1.4
For a joint distribution P(X, Y):
- Compute P(X) by summing P(X, Y) across all values of Y. section 2.1.3
- Compute P(Y) by summing across all values of X. section 2.1.3
- Use marginal distributions to connect joint distributions with conditional probability through the law of total probability. section 2.1.4
Marginalizing a tabular distribution
A joint table assigns probabilities to six combinations of X and Y. Summing over Y produces P(X) = {0.45, 0.30, 0.25}; summing over X produces P(Y) = {0.60, 0.40}. In pgmpy, DiscreteFactor.marginalize(variables=['Y'], inplace=False) returns the new marginal table without modifying the joint distribution. section 2.1.3
Figure 2.5 Marginalizing over Y yields the marginal distribution of X.
Shows how summing over Y yields the marginal distribution of X. section 2.1.3


