Edit Problem


Conditional expectation and variance
|
Easy


(Fanning Out)

Suppose random variables X and Y have joint density given by,

$$f(x,y) = \begin{cases} 1/x, &0 < x < 1, 0 < y < x \\
0, &otherwise \end{cases} $$

This is a long (but revealing) way to compute $V[Y]$

  1. Compute the marginal distribution of X.
  2. Compute $V[Y|X]$. This will be a fuction of X.
  3. Compute $E[ V[Y|X]]$. This will be a number.
  4. Compute $E[Y|X]$. This will be a function of X.
  5. Compute $V[ E[Y|X]]$. This will be a number.
  6. Using the law of total variance, compute $V[Y]$.
Solution:

Let X and Y be random variables with a joint pdf given by

$$f(x,y) =\begin{cases}\frac{1}{x}, & \text{for } 0 < y < x \text{, } 0 < x < 1 \0, & \text{otherwise}\end{cases}$$

1. f(X)

$$f(x) = \int_{0}^{x} \frac{1}{x} dy = \left. \frac{y}{x} \right|_{0}^{x} = 1$$

$$ \rightarrow f(x) =\begin{cases}1 & \text{for } 0 < x < 1 \0 & \text{otherwise}\end{cases}$$\break

2. Compute $V[Y|X]$

We know the following relationship: (see page 68)

$$V[Y|X] = E[Y^2\ X] - (E[Y\mid X])^2$$

  • We first need to find $f(y|x)$

$$f(y | x) = \frac{f(x, y)}{f(x)} = \frac{\frac{1}{x}}{1} = \frac{1}{x}$$

$$ \rightarrow f(y|x) =\begin{cases}\frac{1}{x}, & \text{for } 0 < y < x\0, & \text{otherwise}\end{cases}$$

$$\begin{aligned}E[Y|X] &= \int_{0}^{x} y \frac{1}{x} dy\&= \frac{y^2}{2x}|_{0}^{x} \&= \frac{x}{2}\end{aligned}$$

and by LOTUS

$$\begin{aligned}E[Y^2|X] &= \int_{0}^{x} y^2 \frac{1}{x} dy \&= \frac{y^3}{3x}|_{0}^{x} \&= \frac{x^2}{3}\end{aligned}$$

Putting together the terms for $V[Y | X]$ we have

$$\frac{x^2}{3} - \frac{x^2}{4} = \frac{x^2}{12} \text{, for } 0< x <1$$

\break

3. $E[V[Y|X]]$

  • From number 2, we know that $V[Y|X]=\frac{x^2}{12}$

Then

$$\begin{aligned}E[V(Y\mid X)] &= E[\frac{x^2}{12}] \&= \int_{0}^{1} \frac{x^2}{12} f(x)dx \&= \int_{0}^{1} \frac{x^2}{12} \cdot 1 dx \&=\left. \frac{x^2}{36} \right|_{0}^{1} \&= \frac{1}{36}\end{aligned}$$

\break

4. E[Y|X]

$$\begin{aligned}E[Y|X] &= \int_{0}^{x} y \frac{1}{x} dy \&= \frac{y^2}{2x} |_{0}^{x} \&=\frac{x^2}{2x}\&=\frac{x}{2}\\end{aligned}$$

\break

5. $V[E[Y|X]]$

Think of $E[Y|X]$ as another random variable such as Z, then we can write$V[Z] = E[Z^2] - (E[Z])^2$ (see page 52) . Using this relationship, we can write following

$$V[E[Y \mid X]] = E[(E[Y \mid X])^2] - (E[E[Y \mid X]])^2 $$

from (4), we know $E[Y|X]=\frac{x}{2}$, so the above equation can be written as the following:

$$\begin{aligned}V[E[Y \mid X]] &= E[(E[Y \mid X])^2] - (E[E[Y \mid X]])^2 \&\phantom{}\&=E[(\frac{X}{2})^2]- (E[\frac{X}{2}])^2\&=E[(\frac{X^2}{4})]- (E[\frac{X}{2}])^2\\end{aligned}$$

Now let's evaluate $E[Y|X]=\frac{X^2}{4}$

$$\begin{aligned}E[\frac{X^2}{4}] &= \int_{0}^{1} \frac{x^2}{4} *1 \text{ } dx \&= \int_{0}^{1} \frac{x^2}{4} dx \&= \left. \frac{x^3}{12} \right|{0}^{1} \&= \frac{1}{12}\end{aligned}$$$$\begin{aligned}E[\frac{X^2}{4}] &= \int{0}^{1} \frac{x^2}{4} *1 \text{ } dx \&= \int_{0}^{1} \frac{x^2}{4} dx \&= \left. \frac{x^3}{12} \right|_{0}^{1} \&= \frac{1}{12}\end{aligned}$$

Now let's evaluate $E[Y|X]=\frac{X}{2}$$$\begin{aligned}E[\frac{X}{2}] &= \int_{0}^{1} \frac{x}{2} *1 \text{ } dx\&= \frac{x^2}{4} |_{0}^{1} \&= \frac{1}{4}\end{aligned}$$

Then,

$$\begin{aligned}V[E[Y \mid X]] &= E[(E[Y \mid X])^2] - (E[E[Y \mid X]])^2 \&\phantom{}\&=E[(\frac{X}{2})^2]- (E[\frac{X}{2}])^2\&\phantom{}\&=E[(\frac{X^2}{4})]- (E[\frac{X}{2}])^2\&\phantom{}\&= \frac{1}{12}-\frac{1}{16}\&\phantom{}\&= \frac{1}{48}\end{aligned}$$

\break

6. $V[Y]$ using the law of total variance

Recall that the law of total variance states that (see page 73)

$$V[Y]= E[V(Y\mid X)] + V(E[Y \mid X])$$From (3), we got $E[V[Y|X]]= \frac{1}{24}$ and from (5), we got $V[E[Y|X]]=\frac{1}{48}$

$$\begin{aligned}V[Y]&= E[V(Y\mid X)] + V(E[Y \mid X])\&=\frac{1}{36}+\frac{1}{48}\\end{aligned}$$