Find the conditional density function and expectation of $Y$ given $X$ when $f(x,y) = \lambda^{2}e^{-\lambda y}$ and $f(x,y) = xe^{-x(y+1)}$

conditional-expectationdensity functionprobabilityprobability distributionssolution-verification

Find the conditional density function and expectation of $Y$ given $X$ when they have joint density function:

(a) $f(x,y) = \lambda^{2}e^{-\lambda y}\quad\text{for}\quad 0\leq x < y < +\infty$

(b) $f(x,y) = xe^{-x(y+1)}\quad\text{for}\quad x,y\geq0$

MY SOLUTION

(a) By definition, we have
\begin{align*}
f_{X}(x) = \int_{x}^{\infty}\lambda^{2}e^{-\lambda y}\mathrm{d}y = \lambda e^{-\lambda x}\quad\text{for}\quad x\geq 0
\end{align*}

Consequently, we have
\begin{align*}
f_{Y|X}(y|x) = \frac{f_{X,Y}(x,y)}{f_{X}(x)} = \frac{\lambda^{2}e^{-\lambda y}}{\lambda e^{-\lambda x}} = \lambda e^{-\lambda(y-x)}\quad\text{for}\quad y\geq x \geq 0
\end{align*}

Finally, the conditional expectation can be calculated using integration by parts:
\begin{align*}
\textbf{E}(Y|X) = \int_{x}^{\infty}yf_{Y|X}(y|x)\mathrm{d}y = \int_{x}^{\infty}\lambda ye^{-\lambda(y-x)}\mathrm{d}y = x + \frac{1}{\lambda}\quad\text{for}\quad x\geq 0
\end{align*}

(b) Once again, by definition we deduce that
\begin{align*}
f_{X}(x) = \int_{0}^{\infty}f_{X,Y}(x,y)\mathrm{d}y = \int_{0}^{\infty}xe^{-x(y+1)}\mathrm{d}y = e^{-x}
\end{align*}

Thenceforth we are able to determine the conditional probability density function:

\begin{align*}
f_{Y|X}(y|x) = \frac{f_{X,Y}(x,y)}{f_{X}(x)} = \frac{xe^{-x(y+1)}}{e^{-x}} = xe^{-xy}\quad\text{for}\quad x,y\geq 0
\end{align*}

Finally, the conditional expectation is given by
\begin{align*}
\textbf{E}(Y|X) = \int_{0}^{\infty}yf_{Y|X}(y|x)\mathrm{d}y = \int_{0}^{\infty}xye^{-xy}\mathrm{d}y = \frac{1}{x} > 0
\end{align*}

Best Answer

All of your calculations are correct except for the very last step of the last equation for part (b), which should be $\operatorname{E}[Y \mid X] = 1/X$. To see why, one can observe $$Y \mid X = \lambda \sim \operatorname{Exponential}(\lambda);$$ that is to say, the conditional distribution of $Y$ given $X = \lambda$ is exponential with rate parameter $\lambda$. Since the expectation of such a distribution is $1/\lambda$--which you correctly calculated in part (a)--it follows that the conditional expectation in part (b) is $1/X$.

Of note is the fact that the conditional distribution in part (a) is a location-shifted exponential distribution with rate $\lambda$ and shift $x$, so naturally its expectation is equal to the expectation of an exponential distribution with rate lambda, plus the amount of shift.