Definition. The joint CDF of ( X , Y ) (X, Y) ( X , Y ) is F X , Y ( x , y ) = P ( X ≤ x , Y ≤ y ) F_{X,Y}(x, y) = P(X \leq x, Y \leq y) F X , Y ( x , y ) = P ( X ≤ x , Y ≤ y ) .
Definition. The joint PDF (for continuous random variables) is f X , Y ( x , y ) ≥ 0 f_{X,Y}(x, y) \geq 0 f X , Y ( x , y ) ≥ 0 such that
F X , Y ( x , y ) = ∫ − ∞ x ∫ − ∞ y f X , Y ( u , v ) d u d v F_{X,Y}(x, y) = \int_{-\infty}^{x}\int_{-\infty}^{y} f_{X,Y}(u, v)\, du\, dv F X , Y ( x , y ) = ∫ − ∞ x ∫ − ∞ y f X , Y ( u , v ) d u d v
Definition. The marginal PDF of X X X is f X ( x ) = ∫ − ∞ ∞ f X , Y ( x , y ) d y f_X(x) = \int_{-\infty}^{\infty} f_{X,Y}(x, y)\, dy f X ( x ) = ∫ − ∞ ∞ f X , Y ( x , y ) d y .
Definition. The covariance of X X X and Y Y Y is
C o v ( X , Y ) = E [ ( X − E [ X ] ) ( Y − E [ Y ] ) ] = E [ X Y ] − E [ X ] E [ Y ] \mathrm{Cov}(X, Y) = E[(X - E[X])(Y - E[Y])] = E[XY] - E[X]E[Y] Cov ( X , Y ) = E [( X − E [ X ]) ( Y − E [ Y ])] = E [ X Y ] − E [ X ] E [ Y ]
Proposition 2.6. C o v ( X , Y ) = C o v ( Y , X ) \mathrm{Cov}(X, Y) = \mathrm{Cov}(Y, X) Cov ( X , Y ) = Cov ( Y , X ) and C o v ( a X + b , c Y + d ) = a c C o v ( X , Y ) \mathrm{Cov}(aX + b, cY + d) = ac\,\mathrm{Cov}(X, Y) Cov ( a X + b , c Y + d ) = a c Cov ( X , Y ) .
Definition. The correlation coefficient is
ρ ( X , Y ) = C o v ( X , Y ) V a r ( X ) V a r ( Y ) \rho(X, Y) = \frac{\mathrm{Cov}(X, Y)}{\sqrt{\mathrm{Var}(X)\,\mathrm{Var}(Y)}} ρ ( X , Y ) = Var ( X ) Var ( Y ) Cov ( X , Y )
Theorem 2.7 (Cauchy—Schwarz for Random Variables). ∣ ρ ( X , Y ) ∣ ≤ 1 |\rho(X, Y)| \leq 1 ∣ ρ ( X , Y ) ∣ ≤ 1 , with equality if and only if Y = a X + b Y = aX + b Y = a X + b almost surely for some a , b a, b a , b .
Definition. X X X and Y Y Y are independent if F X , Y ( x , y ) = F X ( x ) F Y ( y ) F_{X,Y}(x, y) = F_X(x)\, F_Y(y) F X , Y ( x , y ) = F X ( x ) F Y ( y ) for all x , y x, y x , y .
For continuous random variables, this is equivalent to f X , Y ( x , y ) = f X ( x ) f Y ( y ) f_{X,Y}(x, y) = f_X(x)\, f_Y(y) f X , Y ( x , y ) = f X ( x ) f Y ( y ) .
Proposition 2.8. If X X X and Y Y Y are independent, then C o v ( X , Y ) = 0 \mathrm{Cov}(X, Y) = 0 Cov ( X , Y ) = 0 . The converse is false.
Worked Example: Uncorrelated but Dependent Solution. Let X ∼ N ( 0 , 1 ) X \sim N(0, 1) X ∼ N ( 0 , 1 ) and Y = X 2 Y = X^2 Y = X 2 . Then C o v ( X , Y ) = E [ X 3 ] − E [ X ] E [ X 2 ] = 0 − 0 ⋅ 1 = 0 \mathrm{Cov}(X, Y) = E[X^3] - E[X]E[X^2] = 0 - 0 \cdot 1 = 0 Cov ( X , Y ) = E [ X 3 ] − E [ X ] E [ X 2 ] = 0 − 0 ⋅ 1 = 0 (since the third moment of a standard normal is 0).
But Y Y Y is completely determined by X X X , so they are not independent. ■ \blacksquare ■
Definition. The conditional PDF of Y Y Y given X = x X = x X = x is:
f Y ∣ X ( y ∣ x ) = f X , Y ( x , y ) f X ( x ) f_{Y|X}(y|x) = \frac{f_{X,Y}(x, y)}{f_X(x)} f Y ∣ X ( y ∣ x ) = f X ( x ) f X , Y ( x , y )
provided f X ( x ) > 0 f_X(x) > 0 f X ( x ) > 0 .
Definition. The conditional expectation of Y Y Y given X = x X = x X = x is:
E [ Y ∣ X = x ] = ∫ − ∞ ∞ y f Y ∣ X ( y ∣ x ) d y E[Y | X = x] = \int_{-\infty}^{\infty} y\, f_{Y|X}(y|x)\, dy E [ Y ∣ X = x ] = ∫ − ∞ ∞ y f Y ∣ X ( y ∣ x ) d y
The random variable E [ Y ∣ X ] E[Y | X] E [ Y ∣ X ] has the property that E [ E [ Y ∣ X ] ] = E [ Y ] E[E[Y|X]] = E[Y] E [ E [ Y ∣ X ]] = E [ Y ] (law of total expectation).
The bivariate normal distribution has joint PDF:
f X , Y ( x , y ) = 1 2 π σ X σ Y 1 − ρ 2 exp ( − 1 2 ( 1 − ρ 2 ) [ ( x − μ X ) 2 σ X 2 − 2 ρ ( x − μ X ) ( y − μ Y ) σ X σ Y + ( y − μ Y ) 2 σ Y 2 ] ) f_{X,Y}(x, y) = \frac{1}{2\pi\sigma_X\sigma_Y\sqrt{1 - \rho^2}} \exp\left(-\frac{1}{2(1 - \rho^2)}\left[\frac{(x - \mu_X)^2}{\sigma_X^2} - 2\rho\frac{(x - \mu_X)(y - \mu_Y)}{\sigma_X\sigma_Y} + \frac{(y - \mu_Y)^2}{\sigma_Y^2}\right]\right) f X , Y ( x , y ) = 2 π σ X σ Y 1 − ρ 2 1 exp ( − 2 ( 1 − ρ 2 ) 1 [ σ X 2 ( x − μ X ) 2 − 2 ρ σ X σ Y ( x − μ X ) ( y − μ Y ) + σ Y 2 ( y − μ Y ) 2 ] )
where ρ = C o r r ( X , Y ) \rho = \mathrm{Corr}(X, Y) ρ = Corr ( X , Y ) .
Properties of the bivariate normal:
Marginal distributions are normal: X ∼ N ( μ X , σ X 2 ) X \sim N(\mu_X, \sigma_X^2) X ∼ N ( μ X , σ X 2 ) , Y ∼ N ( μ Y , σ Y 2 ) Y \sim N(\mu_Y, \sigma_Y^2) Y ∼ N ( μ Y , σ Y 2 ) . Conditional distribution is normal: Y ∣ X = x ∼ N ( μ Y + ρ σ Y σ X ( x − μ X ) , σ Y 2 ( 1 − ρ 2 ) ) Y | X = x \sim N\left(\mu_Y + \rho \frac{\sigma_Y}{\sigma_X}(x - \mu_X),\ \sigma_Y^2(1 - \rho^2)\right) Y ∣ X = x ∼ N ( μ Y + ρ σ X σ Y ( x − μ X ) , σ Y 2 ( 1 − ρ 2 ) ) . X X X and Y Y Y are independent if and only if ρ = 0 \rho = 0 ρ = 0 .For a transformation ( U , V ) = g ( X , Y ) (U, V) = g(X, Y) ( U , V ) = g ( X , Y ) where g g g is a diffeomorphism, the joint PDF is:
f U , V ( u , v ) = f X , Y ( g − 1 ( u , v ) ) ⋅ ∣ det J g − 1 ∣ f_{U,V}(u, v) = f_{X,Y}(g^{-1}(u, v)) \cdot |\det J_{g^{-1}}| f U , V ( u , v ) = f X , Y ( g − 1 ( u , v )) ⋅ ∣ det J g − 1 ∣
where J J J is the Jacobian matrix of the inverse transformation.
Example. Let X , Y X, Y X , Y be independent exponential(λ \lambda λ ) random variables. The joint PDF of U = X + Y U = X + Y U = X + Y and V = X / ( X + Y ) V = X/(X + Y) V = X / ( X + Y ) factors as f U , V ( u , v ) = λ 2 u e − λ u ⋅ χ ( 0 , 1 ) ( v ) f_{U,V}(u, v) = \lambda^2 u e^{-\lambda u} \cdot \chi_{(0,1)}(v) f U , V ( u , v ) = λ 2 u e − λ u ⋅ χ ( 0 , 1 ) ( v ) , showing U U U and V V V are independent with U ∼ G a m m a ( 2 , λ ) U \sim \mathrm{Gamma}(2, \lambda) U ∼ Gamma ( 2 , λ ) and V ∼ U n i f o r m ( 0 , 1 ) V \sim \mathrm{Uniform}(0, 1) V ∼ Uniform ( 0 , 1 ) .
If X X X and Y Y Y are independent, the PDF of Z = X + Y Z = X + Y Z = X + Y is the convolution:
f Z ( z ) = ∫ − ∞ ∞ f X ( z − y ) f Y ( y ) d y = ∫ − ∞ ∞ f X ( x ) f Y ( z − x ) d x f_Z(z) = \int_{-\infty}^{\infty} f_X(z - y)\, f_Y(y)\, dy = \int_{-\infty}^{\infty} f_X(x)\, f_Y(z - x)\, dx f Z ( z ) = ∫ − ∞ ∞ f X ( z − y ) f Y ( y ) d y = ∫ − ∞ ∞ f X ( x ) f Y ( z − x ) d x
For moment generating functions: M Z ( t ) = M X ( t ) M Y ( t ) M_Z(t) = M_X(t)\, M_Y(t) M Z ( t ) = M X ( t ) M Y ( t ) .
Problem 1. Let X X X and Y Y Y have joint PDF f X , Y ( x , y ) = c ( 1 − x 2 − y 2 ) f_{X,Y}(x, y) = c(1 - x^2 - y^2) f X , Y ( x , y ) = c ( 1 − x 2 − y 2 ) for x 2 + y 2 ≤ 1 x^2 + y^2 \leq 1 x 2 + y 2 ≤ 1 . Find c c c , the marginal PDFs, and P ( X > 0 , Y > 0 ) P(X > 0, Y > 0) P ( X > 0 , Y > 0 ) .
Problem 2. Show that if C o v ( X , Y ) = 0 \mathrm{Cov}(X, Y) = 0 Cov ( X , Y ) = 0 for a bivariate normal pair, then X X X and Y Y Y are independent.
Problem 3. Let X X X and Y Y Y be independent standard normal variables. Find the distribution of R = X 2 + Y 2 R = \sqrt{X^2 + Y^2} R = X 2 + Y 2 and Θ = arctan ( Y / X ) \Theta = \arctan(Y/X) Θ = arctan ( Y / X ) .
Solution. R R R has Rayleigh distribution with PDF f R ( r ) = r e − r 2 / 2 f_R(r) = r e^{-r^2/2} f R ( r ) = r e − r 2 /2 for r ≥ 0 r \geq 0 r ≥ 0 , and Θ ∼ U n i f o r m ( 0 , 2 π ) \Theta \sim \mathrm{Uniform}(0, 2\pi) Θ ∼ Uniform ( 0 , 2 π ) , and R R R and Θ \Theta Θ are independent. ■ \blacksquare ■
Problem 4. Suppose X ∼ N ( 0 , 1 ) X \sim N(0, 1) X ∼ N ( 0 , 1 ) and Y = X + Z Y = X + Z Y = X + Z where Z ∼ N ( 0 , 1 ) Z \sim N(0, 1) Z ∼ N ( 0 , 1 ) is independent of X X X . Find the joint distribution of ( X , Y ) (X, Y) ( X , Y ) and compute C o v ( X , Y ) \mathrm{Cov}(X, Y) Cov ( X , Y ) .
Law of total probability: f Y ( y ) = ∫ − ∞ ∞ f Y ∣ X ( y ∣ x ) f X ( x ) d x f_Y(y) = \int_{-\infty}^{\infty} f_{Y|X}(y|x)\, f_X(x)\, dx f Y ( y ) = ∫ − ∞ ∞ f Y ∣ X ( y ∣ x ) f X ( x ) d x .
Bayes’ theorem: f X ∣ Y ( x ∣ y ) = f Y ∣ X ( y ∣ x ) f X ( x ) f Y ( y ) = f Y ∣ X ( y ∣ x ) f X ( x ) ∫ f Y ∣ X ( y ∣ t ) f X ( t ) d t f_{X|Y}(x|y) = \frac{f_{Y|X}(y|x)\, f_X(x)}{f_Y(y)} = \frac{f_{Y|X}(y|x)\, f_X(x)}{\int f_{Y|X}(y|t)\, f_X(t)\, dt} f X ∣ Y ( x ∣ y ) = f Y ( y ) f Y ∣ X ( y ∣ x ) f X ( x ) = ∫ f Y ∣ X ( y ∣ t ) f X ( t ) d t f Y ∣ X ( y ∣ x ) f X ( x ) .
The joint moment generating function of ( X , Y ) (X, Y) ( X , Y ) is:
M X , Y ( s , t ) = E [ e s X + t Y ] M_{X,Y}(s, t) = E[e^{sX + tY}] M X , Y ( s , t ) = E [ e s X + t Y ]
If X X X and Y Y Y are independent, then M X , Y ( s , t ) = M X ( s ) M Y ( t ) M_{X,Y}(s, t) = M_X(s)\, M_Y(t) M X , Y ( s , t ) = M X ( s ) M Y ( t ) . Joint moments can be recovered by differentiation:
E [ X m Y n ] = ∂ m + n ∂ s m ∂ t n M X , Y ( s , t ) ∣ s = t = 0 E[X^m Y^n] = \frac{\partial^{m+n}}{\partial s^m \partial t^n} M_{X,Y}(s, t)\big|_{s=t=0} E [ X m Y n ] = ∂ s m ∂ t n ∂ m + n M X , Y ( s , t ) s = t = 0
Problem 5. Let ( X , Y ) (X, Y) ( X , Y ) have joint PDF f X , Y ( x , y ) = 6 x f_{X,Y}(x, y) = 6x f X , Y ( x , y ) = 6 x for 0 < x < 1 0 < x < 1 0 < x < 1 , 0 < y < 1 − x 0 < y < 1 - x 0 < y < 1 − x . Find the marginal PDFs and determine if X X X and Y Y Y are independent.
Problem 6. Suppose X X X and Y Y Y are independent exponential random variables with rate λ \lambda λ . Find the distribution of X + Y X + Y X + Y and X / ( X + Y ) X/(X + Y) X / ( X + Y ) . Are they independent?
Problem 7. Show that V a r ( X ) = E [ V a r ( X ∣ Y ) ] + V a r ( E [ X ∣ Y ] ) \mathrm{Var}(X) = E[\mathrm{Var}(X|Y)] + \mathrm{Var}(E[X|Y]) Var ( X ) = E [ Var ( X ∣ Y )] + Var ( E [ X ∣ Y ]) (the variance decomposition formula).