- #1
psie
- 269
- 32
- Homework Statement
- Consider $$f_{X,Y}(x,y)=\begin{cases} c,&\text{for } x,y\geq0, x+y\leq 1,\\ 0,&\text{otherwise}.\end{cases},$$where ##c## is some constant to be determined. Determine ##E(Y\mid X=x)## and ##E(X\mid Y=y)##. Moreover, determine the expected quadratic prediction error ##E(Y-d(X))^2## for the best predictor ##d(X)## of ##Y## based on ##X##.
- Relevant Equations
- The best predictor is the conditional expectation, i.e. ##h(X)=E(Y\mid X)##.
What troubles me about this exercise is that I don't get the answer that the book gets regarding the expected quadratic prediction error.
##c## is determined by $$1=\int_0^1\int_0^{1-x} c\,dydx=c\int_0^1(1-x)\,dx=c\left[-\frac{(1-x)^2}{2}\right]_0^1=\frac{c}2,$$so ##c=2##. The marginal density of ##X## is $$f_X(x)=\int_0^{1-x}2\,dy=2(1-x),\quad 0<x<1.$$And the conditional one is $$f_{Y\mid X=x}(y)=\frac{f_{X,Y}(x,y)}{f_X(x)}=\frac2{2(1-x)}=\frac1{1-x},\quad 0<y<1-x.$$Finally, $$E(Y\mid X=x)=\int_0^{1-x}y\cdot\frac1{1-x}\,dy=\frac1{1-x}\left[\frac{y^2}{2}\right]_0^{1-x}=\frac{(1-x)^2}{2(1-x)}=\frac{1-x}{2}.$$ By symmetry, ##E(X\mid Y=y)=\frac{1-y}{2}##.
I am confident everything is correct up to this point, as this is actually an example in the book and done exactly the same way. But the next part is omitted in the book, i.e. determining the expected quadratic prediction error ##E(Y-E(Y\mid X))^2##, where ##E(Y\mid X)=(1-X)/2##. We can simplify as follows \begin{align*}E(Y-E(Y\mid X))^2&=E(Y-(1-X)/2)^2 \\ &=E(Y^2+(1-X)^2/4-Y(1-X)) \\ &=E\left(Y^2+\frac14-\frac{X}{2}+\frac{X^2}{4}-Y+YX\right).\end{align*} Since ##X,Y## have the exact same distribution, we can replace ##Y## with ##X## except in the last term I believe, i.e. except in ##YX##. So we have $$E\left(\frac{5X^2}{4}+\frac14-\frac{3X}{2}+YX\right)=\frac54E(X^2)+\frac14-\frac32E(X)+E(YX).$$ I used WolframAlpha to compute the three expectations on the right-hand side of this last equation:
##E(X)=\frac13##: first integral
##E(X^2)=\frac16##: second integral
##E(XY)=\frac1{12}##: third integral
Therefor $$E(Y-(1-X)/2)^2 =\frac54\cdot\frac16+\frac14-\frac32\cdot\frac13+\frac1{12}=\frac1{24}.$$The book gets ##\frac1{48}##.
##c## is determined by $$1=\int_0^1\int_0^{1-x} c\,dydx=c\int_0^1(1-x)\,dx=c\left[-\frac{(1-x)^2}{2}\right]_0^1=\frac{c}2,$$so ##c=2##. The marginal density of ##X## is $$f_X(x)=\int_0^{1-x}2\,dy=2(1-x),\quad 0<x<1.$$And the conditional one is $$f_{Y\mid X=x}(y)=\frac{f_{X,Y}(x,y)}{f_X(x)}=\frac2{2(1-x)}=\frac1{1-x},\quad 0<y<1-x.$$Finally, $$E(Y\mid X=x)=\int_0^{1-x}y\cdot\frac1{1-x}\,dy=\frac1{1-x}\left[\frac{y^2}{2}\right]_0^{1-x}=\frac{(1-x)^2}{2(1-x)}=\frac{1-x}{2}.$$ By symmetry, ##E(X\mid Y=y)=\frac{1-y}{2}##.
I am confident everything is correct up to this point, as this is actually an example in the book and done exactly the same way. But the next part is omitted in the book, i.e. determining the expected quadratic prediction error ##E(Y-E(Y\mid X))^2##, where ##E(Y\mid X)=(1-X)/2##. We can simplify as follows \begin{align*}E(Y-E(Y\mid X))^2&=E(Y-(1-X)/2)^2 \\ &=E(Y^2+(1-X)^2/4-Y(1-X)) \\ &=E\left(Y^2+\frac14-\frac{X}{2}+\frac{X^2}{4}-Y+YX\right).\end{align*} Since ##X,Y## have the exact same distribution, we can replace ##Y## with ##X## except in the last term I believe, i.e. except in ##YX##. So we have $$E\left(\frac{5X^2}{4}+\frac14-\frac{3X}{2}+YX\right)=\frac54E(X^2)+\frac14-\frac32E(X)+E(YX).$$ I used WolframAlpha to compute the three expectations on the right-hand side of this last equation:
##E(X)=\frac13##: first integral
##E(X^2)=\frac16##: second integral
##E(XY)=\frac1{12}##: third integral
Therefor $$E(Y-(1-X)/2)^2 =\frac54\cdot\frac16+\frac14-\frac32\cdot\frac13+\frac1{12}=\frac1{24}.$$The book gets ##\frac1{48}##.