# The joint probability density function

## Contents

# The joint probability density function¶

Consider two continuous random variables \(X\) and \(Y\).
The *joint probability density function* of the pair \((X,Y)\) is the function \(p(x,y)\) giving the probability density around \(X=x\) and \(Y=y\).
Mathematically, we have:

with equality when the box around \((x,y)\) shrinks to a point. Here \(I\) is any background information we may have. If there is no ambiguity, we can drop the background information and write \(p(x,y)\) instead. But remember, that there is always some background information…

## Properties of the joint probability density function¶

It is nonnegative:

If you integrate over all the possible values of all random variables, you should get one:

If you

*marginalize*over the values of one of the random variables you get the PDF of the other. For example:

and

The marginalization property is a direct consequence of the sum rule of probability.

If you take a subset \(A\) of \(\mathbb{R}^2\), then the probability that \((X,Y)\) is in \(A\) is given by:

\[ p\left((X,Y)\in A\right) = \int_{A} f_{X,Y}(x,y)dxdy. \]

This is a standard double integral.

## Conditioning a random variable on another¶

If we had observed that \(Y=y\), how would this change the PDF of \(X\)? The answer is given via Bayes’ rule. The PDF of \(X\) conditioned on \(Y=y\) is:

This is called the conditional PDF of \(X\) given \(Y=y\).

## Independent random variables¶

We say that two random variables \(X\) and \(Y\) are independent given the background information \(I\) if and only if conditioning on one does not tell you anything about the other, i.e.,

We may be dropping \(I\) if it is fixed. A very important property of independent random variables is that their joint PDF is the product of individual PDFs:

You can prove this very easily using the product rule and the definition of independence. Here it is:

It is also very easy to show that if \(Y\) does not give any information about \(X\), then the reverse also holds:

## The joint PDF of more than two random variables¶

Finally, note that the concept of joint PDF and independence, generalizes to arbitrary number of random variables. For example, you could have \(p(x, y, z)\) or \(p(x, y, z, w)\), etc. You can do all sorts of things with these object, e.g., your can marginalize any number of them to get the joint PDF of the rest:

or you can condition on one or more of the random variables.

If they were all independent, then the joint PDF would factorize like this:

There is a lot of meat here, but it is beyond the scope of this class to cover everything…