Joint Probability Density Function
A Joint Probability Density Function f(x,y) describes the Multivariate Distribution of two continuous random variables. Probability is volume under the surface f: to find P((X,Y) \in A), integrate f over the region A.
P\bigl((X,Y) \in A\bigr) = \iint_A f(x,y)\,dA
f_X(x) = \int f(x,y)\,dy
f_{Y \mid X}(y \mid x) = \frac{f(x,y)}{f_X(x)}
- A valid joint density satisfies
f(x,y) \geq 0and integrates to 1 over its support. Setting that double integral equal to 1 is how an unknown constantcis found. - The marginal
f_X(x)integratesyout — the limits on that inner integral depend onxwhenever the support is not a rectangle. The marginal is a function ofxalone; ifysurvives, the limits were wrong. XandYare independent only iff(x,y) = f_X(x)f_Y(y)and the support is a rectangle. A triangular support such as0 < x < y < 1forces dependence no matter how the formula factors, because the range ofYdepends onx.E[g(X,Y)] = \iint g(x,y) f(x,y)\,dx\,dy— see Moments for Joint Distributions and Covariance.
Setting up the limits
The integrand is rarely the hard part; the region is. Work in this order:
- Sketch the support. Shade the set of
(x,y)wheref > 0. - Pick an outer variable and read off its full numeric range — those limits must be constants.
- Slice. Holding the outer variable fixed, read the inner variable's range off the sketch — those limits may involve the outer variable.
- Sanity check: the outer limits are always numbers; the inner limits may mention the outer variable but never the inner variable itself — the limits on
dynever containy.
\int_{a}^{b}\!\!\int_{g_1(x)}^{g_2(x)} f(x,y)\,dy\,dx
Reversing the order of integration is a legitimate move and is often far easier — but the limits must be re-derived from the sketch, not swapped mechanically.
Finding the Normalizing Constant on a Triangle
f(x,y) = c(x+y)on the region0 < x < y < 1. Findc.Answer The support is the triangle above the line
y = xinside the unit square. Integratexfrom 0 to 1; for eachx,yruns fromxup to 1:\begin{align*} 1 &= \int_0^1\!\!\int_x^1 c(x+y)\,dy\,dx \\ &= c\int_0^1 \left[xy + \tfrac{y^2}{2}\right]_{y=x}^{y=1} dx \\ &= c\int_0^1 \left(x + \tfrac{1}{2} - x^2 - \tfrac{x^2}{2}\right) dx \\ &= c\int_0^1 \left(x + \tfrac{1}{2} - \tfrac{3x^2}{2}\right) dx \\ &= c\left[\tfrac{1}{2} + \tfrac{1}{2} - \tfrac{1}{2}\right] \\ &= \frac{c}{2} \end{align*}So
c = 2.
Marginal Density on a Non-Rectangular Support Losses on two coverages have
f(x,y) = 8xyfor0 < x < y < 1. Find the marginal density ofY.Answer To get
f_Y(y), integratexout. On the sketch, fixingymeansxruns from 0 up toy— not from 0 to 1:\begin{align*} f_Y(y) &= \int_0^y 8xy\,dx \\ &= 8y\left[\tfrac{x^2}{2}\right]_0^y \\ &= 4y^3, \quad 0 < y < 1 \end{align*}Check:
\int_0^1 4y^3\,dy = 1. Using limits 0 to 1 forxwould have given4y, which integrates to 2 — an immediate signal the region was wrong.
Probability over a Region and a Conditional Density With
f(x,y) = 8xyon0 < x < y < 1, findP(Y > 2X)and the conditional densityf_{X \mid Y}(x \mid y).Answer The event
Y > 2Xis the part of the triangle above the liney = 2x. Integratingxoutermost,yruns from2xto 1, andxcan go no higher than\tfrac{1}{2}:\begin{align*} P(Y > 2X) &= \int_0^{1/2}\!\!\int_{2x}^{1} 8xy\,dy\,dx \\ &= \int_0^{1/2} 4x\left[y^2\right]_{2x}^{1} dx \\ &= \int_0^{1/2} \left(4x - 16x^3\right) dx \\ &= \left[2x^2 - 4x^4\right]_0^{1/2} \\ &= \tfrac{1}{2} - \tfrac{1}{4} \\ &= 0.25 \end{align*}Dividing the joint by the marginal
f_Y(y) = 4y^3from the previous example:\begin{align*} f_{X \mid Y}(x \mid y) &= \frac{8xy}{4y^3} \\ &= \frac{2x}{y^2}, \quad 0 < x < y \end{align*}Given
Y = y,Xis confined to(0, y)— the conditional support shrinks withy, which is exactly whyXandYcannot be independent here even though8xyfactors as(8x)(y).