In probability theory and statistics, the marginal distribution of a subset of a collection of random variables is the probability distribution of the variables contained in the subset. It gives the probabilities of various values of the variables in the subset without reference to the values of the other variables. This contrasts with a conditional distribution, which gives the probabilities contingent upon the values of the other variables.
Marginal variables are those variables in the subset of variables being retained. These concepts are "marginal" because they can be found by summing values in a table along rows or columns, and writing the sum in the margins of the table. The distribution of the marginal variables (the marginal distribution) is obtained by marginalizing (that is, focusing on the sums in the margin) over the distribution of the variables being discarded, and the discarded variables are said to have been marginalized out.
The context here is that the theoretical studies being undertaken, or the data analysis being done, involves a wider set of random variables but that attention is being limited to a reduced number of those variables. In many applications, an analysis may start with a given collection of random variables, then first extend the set by defining new ones (such as the sum of the original random variables) and finally reduce the number by placing interest in the marginal distribution of a subset (such as the sum). Several different analyses may be done, each treating a different subset of variables as the marginal distribution.
Definition
Marginal probability mass function
Given a known joint distribution of two discrete random variables, say, and , the marginal distribution of either variable – for example – is the probability distribution of when the values of are not taken into consideration. This can be calculated by summing the joint probability distribution over all values of . Naturally, the converse is also true: the marginal distribution can be obtained for by summing over the separate values of .
, and
A marginal probability can always be written as an expected value:
Intuitively, the marginal probability of X is computed by examining the conditional probability of X given a particular value of Y, and then averaging this conditional probability over the distribution of all values of Y.
This follows from the definition of expected value (after applying the law of the unconscious statistician)
Therefore, marginalization provides the rule for the transformation of the probability distribution of a random variable Y and another random variable :
Marginal probability density function
Given two continuous random variables X and Y whose joint distribution is known, then the marginal probability density function can be obtained by integrating the joint probability distribution, , over Y, and vice versa. That is
where , and .
Marginal cumulative distribution function
Finding the marginal cumulative distribution function from the joint cumulative distribution function is easy. Recall that:
For discrete random variables, For continuous random variables,
If X and Y jointly take values on [a, b] × [c, d] then
and
If d is ∞, then this becomes a limit . Likewise for .
Marginal distribution vs. conditional distribution
Definition
The marginal probability is the probability of a single event occurring, independent of other events. A conditional probability, on the other hand, is the probability that an event occurs given that another specific event has already occurred. This means that the calculation for one variable is dependent on another variable.
The conditional distribution of a variable given another variable is the joint distribution of both variables divided by the marginal distribution of the other variable. That is,
For discrete random variables, For continuous random variables,
Example
Suppose there is data from a classroom of 200 students on the amount of time studied (X) and the percentage of correct answers (Y). Assuming that X and Y are discrete random variables, the joint distribution of X and Y can be described by listing all the possible values of p(xi,yj), as shown in Table.3.
The marginal distribution can be used to determine how many students scored 20 or below: , meaning 10 students or 5%.
The conditional distribution can be used to determine the probability that a student that studied 60 minutes or more obtains a scored of 20 or below: , meaning there is about a 11% probability of scoring 20 after having studied for at least 60 minutes.