5.3 - continuous marginal and conditional distributions

Marginal CDFs

  • Recall that if \(X\) and \(Y\) have joint CDF given by \(F(x,y)\), then the marginal CDFs are defined as:

\[F_X(x) = P(X\leq x) =\lim_{y\rightarrow \infty} F(x,y)\] \[F_Y(y) = P(Y\leq y) =\lim_{x\rightarrow \infty} F(x,y)\]

  • This result holds for any pair of random variables (jointly discrete, jointly continuous, mixture).

Marginals for jointly continuous random variables

  • If \(X\) and \(Y\) are jointly continuous with joint pdf \(f(x,y)\), then the marginal probability density functions are defined as:

\[f_X(x) = \int_{-\infty}^\infty f(x,y) dy\]

\[f_Y(y) = \int_{-\infty}^\infty f(x,y) dx\]

  • Another way of finding the marginal pdfs is to differentiate the marginal CDFs:

\[f_X(x) = \frac{d}{dx} F_X(x)\] \[f_Y(y) = \frac{d}{dy} F_Y(y)\]

Note on notation

  • Let’s clarify this subscript/argument notation!
    • \(F_X(x) = P(X\leq x)\): the marginal CDF of \(X\) evaluated at \(x\) (analogously defined for \(F_Y(y)\))
    • \(f_Y(y)\): the marginal pdf of \(Y\) evaluated at \(y\) (analogously defined for \(f_X(x)\))
  • The subscripts define the function, not the argument! (Think: \(f_Y(\cdot)\) and \(f_X(\cdot)\) as \(h(\cdot)\) and \(g(\cdot)\))
  • Example: suppose \(Y\sim EXP(\lambda)\) and \(X\sim UNIF(0,1)\).

\[F_Y(x) = \begin{cases} 0 & x \leq 0 \\ 1-e^{-\lambda x}& x> 0 \end{cases}\]

\[f_Y(x) = \begin{cases}\lambda e^{-\lambda x} & x> 0\\ 0 & otherwise \end{cases}\]

\[F_X(y) =\begin{cases} 0 & y < 0 \\ y &0 \leq y \leq 1 \\ 1 & y > 1\end{cases}\]

\[f_X(y) = \begin{cases} 1 & 0 \leq y \leq 1 \\ 0 & otherwise \end{cases}\]

Example: wedge over \((0,1)^2\)

Suppose \(X\) and \(Y\) are jointly continuous with joint pdf:

\[f(x,y) = \begin{cases} 2x & 0 < x < 1, 0 < y < 1 \\ 0 & otherwise \end{cases}\]

Support:

Visualization of support over unit square

Desmos screenshot (interactive: https://www.desmos.com/3d/rrimrnv8mt)

Views of joint density along X and Y axes

Finding the marginals

\[f_X(x) = \int_0^1 2x\ dy = 2xy\big|_{y=0}^1 = \begin{cases} 2x& 0 < x < 1\\ 0 & otherwise \end{cases}\] \(X \sim BETA(2,1)\)

\[f_Y(y) = \int_0^1 2x\ dx = x^2\big|_{x=0}^1 = \begin{cases} 1 & 0 < y < 1\\ 0 & otherwise \end{cases}\] \(Y \sim UNIF(0,1)\)

Conditional densities

If \(X\) and \(Y\) are jointly continuous random variables with joint pdf \(f(x,y)\), then the conditional density functions are defined accordingly:

  • For any \(y\) such that \(f_Y(y)>0\):

\[f_{X|Y}(x|y) = \frac{f(x,y)}{f_Y(y)}\]

  • For any \(x\) such that \(f_X(x)>0\):

\[f_{Y|X}(y|x) = \frac{f(x,y)}{f_X(x)}\]

  • Conditionals have all the properties of a univariate pdf:
    • \(f_{X|Y}(x|y)\geq 0\ \forall\ x\)
    • \(\int_{-\infty}^\infty f_{X|Y}(x|y)\ dx = 1\)
    • \(f_{Y|X}(y|x)\geq 0\ \forall\ y\)
    • \(\int_{-\infty}^\infty f_{Y|X}(y|x)\ dy = 1\)
  • For ease of notation, we may at times drop the subscripts on these conditionals.

Conditional CDFs

If \(X\) and \(Y\) are jointly continuous random variables with conditional pdfs as defined previously, then:

\[F_{X|Y}(x|y) = P(X \leq x|Y=y) = \int_{-\infty}^x f_{X|Y}(t|y)\ dt\] \[F_{Y|X}(y|x) = P(Y \leq y|X=x) = \int_{-\infty}^y f_{Y|X}(t|x)\ dt\]

As in univariate case, we can differentiate conditional CDFs to yield conditional pdfs:

\[f_{X|Y}(x|y) = \frac{d}{dx} F_{X|Y}(x|y)\] \[f_{Y|X}(y|x) = \frac{d}{dy} F_{Y|X}(y|x)\]

Example: uniform over triangle

Suppose \(X\) and \(Y\) are jointly continuous with joint pdf:

\[f(x,y) = \begin{cases} \frac{1}{2} & 0 < x < y < 2 \\ 0 & otherwise \end{cases}\]

Find \(P(X < 1/2 | Y = 1.5)\).

Process:

  1. Find marginal pdf of \(Y\),
  2. Find conditional pdf \(f_{X|Y}\),
  3. Integrate to find conditional CDF \(F_{X|Y}\).

Example: uniform over triangle

Support with horizontal strip:

Visualization of triangular support

\[f_Y(y) = \int_0^y \frac{1}{2}\ dx =\frac{x}{2}\big|_{x=0}^y= \begin{cases} y/2 & 0 < y < 2 \\ 0 & otherwise \end{cases}\]

For \(0 < y < 2\): \[f_{X|Y}(x|y) = \frac{f(x,y)}{f_Y(y)} = \frac{1/2}{y/2} = \begin{cases} \frac{1}{y} & 0 < x < y \\ 0 & otherwise \end{cases}\] Note: \(X|Y=y \sim UNIF(0,y)\)!

For \(0 < x < y\): \[P(X \leq x | Y=y) = \int_0^x f_{X|Y}(t|y) dt= \int_0^x 1/y\ dt = x/y\] \[F_{X|Y}(x|y) = \begin{cases} 0 & x \leq 0 \\ x/y & 0 < x < y \\ 1 & x \geq y \end{cases}\]

\[\therefore P(X<1/2 | Y=1.5) = F_{X|Y}(0.5|1.5) = \frac{1}{3}\]

Example: mouse ears

Let \(X\) and \(Y\) have the following joint pdf:

\[\scriptsize f(x,y) = \left\{\begin{array}{ll} 30xy^2 & x-1\leq y \leq 1-x;\ 0\leq x \leq 1 \\ 0 & otherwise\\ \end{array}\right.\]

Visual of joint density

(Fully interactive: https://www.desmos.com/3d/zhoozavkw8)

Tasks:

  • Find marginal pdfs
  • Find \(P(Y>0|X=0.75)\)
    • Find \(f_{Y|X}\)
    • Find \(F_{Y|X}\)

Marginal of \(X\)

Support: \(x-1\leq y \leq 1-x, 0 \leq x \leq 1\)

Support with vertical strip

Visual of marginal density of X

\[f_X(x) = \int_{x-1}^{1-x} 30xy^2\ dy\]

\[=10xy^3 \big|_{y=x-1}^{1-x} = 10x(1-x)^3-10x(x-1)^3\] \[= 10x(1-x)^3-10x(-1)^3(1-x)^3\] \[= \begin{cases} 20x(1-x)^3 & 0 < x < 1 \\ 0 & otherwise \end{cases}\]

\[X\sim BETA(2,4)!\]

Marginal of \(Y\)

Support: \(x-1\leq y \leq 1-x, 0 \leq x \leq 1\)

Support with horizontal strips

Visual of marginal density of Y

For \(0 < y < 1\): \[f_Y(y) = \int_{0}^{1-y} 30xy^2\ dx\] \[ = 15x^2y^2\big|_{x=0}^{1-y} = 15(1-y)^2y^2\]

For \(-1 < y < 0\): \[f_Y(y) = \int_{0}^{1+y} 30xy^2\ dx\] \[ = 15x^2y^2\big|_{x=0}^{1+y} = 15(1+y)^2y^2\]

\[f_Y(y) = \begin{cases}15y^2(1-|y|)^2& -1 < y < 1 \\ 0 & otherwise \end{cases}\]

Conditional pdf \(f_{Y|X}\)

For \(0 < x < 1\):

\[f_{Y|X}(y|x) = \frac{f(x,y)}{f_{X}(x)} = \frac{30xy^2}{20x(1-x)^3}\]

\[= \begin{cases} \frac{3y^2}{2(1-x)^3}& x-1 \leq y \leq 1-x \\ 0 & otherwise \end{cases} \]

Conditional CDF \(F_{Y|X}\)

For \(x-1 < y < 1-x\):

\[F_{Y|X}(y|x) = \int_{x-1}^y\frac{3t^2}{2(1-x)^3}\ dt = \frac{1}{2(1-x)^3}t^3\big|_{t=x-1}^y = \frac{y^3-(x-1)^3}{2(1-x)^3}\]

\[F_{Y|X}(y|x) = \begin{cases} 0 & y \leq x-1 \\ \frac{y^3-(x-1)^3}{2(1-x)^3} & x-1 < y < 1-x \\ 1 & y \geq 1-x \end{cases}\]

\(P(Y>0|X=0.75)\)

\[F_{Y|X}(y|0.75) = \begin{cases} 0 & y \leq -0.25 \\ \frac{y^3-(-0.25)^3}{2(0.25)^3} & -0.25 < y < 0.25 \\ 1 & y \geq 0.25 \end{cases}\]

\[\therefore P(Y>0|X=0.75) = 1-F_{Y|X}(0|0.75)= 1-\frac{0^3-(-0.25)^3}{2(0.25)^3} = 0.5\]