< Probability and statistics definitions < Marginal probability function

## What is a marginal probability function?

The marginal probability function is performed by summing joint probabilities.

Suppose that two discrete random variables X, Y have a joint probability function p(x,y) = P[X = x, Y = y], Then

**pX(x) = P[X = x]**is the marginal probability function of X and**pY(y) = P[Y = y]**is the marginal probability function of Y.

## Example: Marginal probability mass function (PMF)

The marginal probability mass function is defined as [1]

You can find the marginal probability mass function (PMF) of X by summing the joint probabilities using the above formula.

For example, suppose you had an urn of ten balls with four blue, three black and three red balls. The following joint probability mass function table shows the joint PMF for (X, Y) balls in an urn:

X (number of black balls) | 0 | 1 | 2 | 3 |

0 | 0 | 0 | 6/252 | 12/252 |

1 | 0 | 12/252 | 54/252 | 36/252 |

2 | 3/252 | 36/252 | 54/252 | 12/252 |

3 | 3/252 | 12/252 | 6/252 | 0 |

*Table 1: Joint PMF*

We can use the joint PMF table to find probabilities. For example, the probability that exactly three black balls are chosen — P(X = 3) — is found by summing values of the PMF where X = 3.

X (number of black balls) | 0 | 1 | 2 | 3 |

0 | 0 | 0 | 6/252 | 12/252 |

1 | 0 | 12/252 | 54/252 | 36/252 |

2 | 3/252 | 36/252 | 54/252 | 12/252 |

3 | 3/252 |
12/252 |
6/252 |
0 |

*Table 1 with probability of X = 3, highlighted in blue.*

Using the formula, summing the probabilities, we get **3/252 + 12/252 + 6/252 = 21/252.**

We can find the marginal PMF of X from Table 1 by repeating this process for each value of X. For example, row 0 is the sum of 6/252 and 12/252.

x | f_{X}(x) |

0 | 21/252 |

1 | 105/252 |

2 | 105/252 |

3 | 21/252 |

*Table 2: Marginal PMF of X.*

We can find also find the marginal PMF of Y from Table 1 in a similar way. Suppose we wanted to know P(Y = 3). We could sum the probabilities in table 1 over the rows in the column where Y = 3:

X (number of black balls) | 0 | 1 | 2 | 3 |

0 | 0 | 0 | 6/252 | 12/252 |

1 | 0 | 12/252 | 54/252 | 36/252 |

2 | 3/252 | 36/252 | 54/252 | 12/252 |

3 | 3/252 | 12/252 | 6//252 | 0 |

*Table 1*Which gives us 12/252 + 36/252 + 12/252 = 60/252.

*with probability of Y = 3, bolded.*

If we repeat this process for all columns, we get the marginal PMF of Y.

y | f_{Y}(y) |

0 | 6/252 |

1 | 60/252 |

2 | 120/252 |

3 | 60/252 |

4 | 6/252 |

*Table 3: Marginal PMF of Y.*

## Marginal probability function in Bayesian statistics

In Bayesian statistics, a marginal probability function is a multivariate probability function that gives the marginal probability for an event without a posteriori knowledge of other random variable’s events [2]. *A posteriori* refers to the probability of an event after taking into account all evidence.

## References

- Chapter 6 Joint Probability Distributions. Retrieved August 6, 2023 from: https://bayesball.github.io/BOOK/joint-probability-distributions.html
- Melli, G. Marginal Probability Function. Retrieved August 6, 2023 from: http://www.gabormelli.com/RKB/Marginal_Probability_Function