# Marginal distribution

## In words...

Given a random pair (or a random vector), the marginal probability distribution models the distribution of one of (or a subset of) the variables.

For a discrete random pair, the marginal distribution of a variable gives the probability of observing its values independently of the value of the other. It can be computed as the sum of the probabilities of observing pair of values for all possible values of the second variable.

For a continuous random pair, the marginal probability density function of a variable is obtained by summing (integrating) the joint probability density function over all possible values of the second variable.

## In picture...

The marginal density function can be pictured as a projection of the joint pdf onto one of the variables...

## In maths...

### Marginal probability distribution for discrete random pairs

Given a discrete random pair $(X,Y)\in\X\times\Y$, the marginal probability distribution of $X$ (respectively $Y$) is defined as $$P_{X} : \Sigma_X \rightarrow [0,1]$$ with $$P_{X} ( x ) = P(X=x ) = \sum_{y\in\Y} P(X=x,\ Y=y) = \sum_{y\in\Y} P_{X,Y}(x,\ y) ,$$ where $P_{X,Y}$ is the joint probability distribution of $(X,Y)$.

### Marginal probability density function for continuous random pairs

Given a continuous random pair $(X,Y)\in\X\times\Y$, the marginal probability density function of $X$ is defined as $$p_{X} : \X \rightarrow \R^+$$ with $$p_{X}( x ) = \int_{\Y} p_{X,Y}(x,y) dy$$ where $p_{X,Y}$ is the joint probability density function of $(X,Y)$.

## Notes

The conditional probability $P(A|B)$ is not well-defined when $P(B)=0$. However, this case can be dealt with by setting $P(A|B)$ to an arbitrary value. Indeed, this value does not influence the computations involving $P(A|B)$ since it corresponds to the probability of observing $A$ given that an event with zero probability occurred.