# Bivariate and Marginal Distribution

## Joint Mass Function

Remember the probability mass function definition. That is the study of one random variable.

Given two discrete random variables X and Y, the joint mass function is defined by
f(x, y) = P(X = x, Y = y)

here “,” means and.

Example: Let us suppose two random variables X and Y each taking values 0 or 1: Study this table carefully and understand how bivariate distribution works. The probability of X = 0 is 1/3 and X = 1 is 2/3 similarly Y has probabilities for both its values (This is marginal distribution. Discussed in the next section). But when we take into account the occurrence of both random variables concurrently, the probability gets reduced. The probabilities of X = 1 and Y = 1 together is 4/9. Thus, P(X = 1, Y = 1) = f(1, 1) = 4/9. This study of two random variables together is bivariate distribution.

In the continuous case, we call a function f (x, y) a pdf for the random variables (X, Y ) if In the discrete or continuous case we define the joint CDF as
FX,Y(x, y) = P(X ≤ x, Y ≤ y)

## Marginal Distribution

If (X, Y) have joint dsitribution with mass function fX,Y,
then the marginal mass function for X is defined by
fX(x) = P(X = x) = ∑y P(X = x, Y = y) = ∑y f(x, y)

and the marginal mass function for Y is defined by
fY(y) = P(Y = y) = ∑x P(X = x, Y = y) = ∑x f(x, y)

Let us table the example discussed above The marginal distribution for X corresponds to the row totals and the marginal distribution for Y corresponds to the column totals.
Thus fX(0) = 1/3 and fX(1) = 2/3.

For continuous random variables , the marginal densities are
fX(x) = ∫ f(x, y)dy,       and      fY(y) = ∫ f(x, y)dx,

The marginal distribution function are denoted by FX and FY. Marginal distribution plotted on both axis. You can see the mean of one variate close to 1 and another close to 0 as passed in the parameter.