# Thread: maths stats - conditional density function

1. ## maths stats - conditional density function

I'm just very confused about conditional density function. like the question is to show that Ey[E(X|Y)] = E(X)

x=0 x=1 x=2 x=3
y = 0 o.o4 o.o5 o.o6 o.o7
y=1 o.o6 o.o8 o.o7 o.o9
y=2 o.1 o.11 o.13 o.14

well i think that E(X) is
0x.04 + 0x.06 + 0x.1 + 1x.05 + 1x.08 + 1x.11 + 2x.06 + 2x.07 + 2x.13 + 3x.07 + 3x.09 + 3x.14 = 1.66

and that E(X|Y) = P(x,y)/P(y)

but the thing is that i dont know how to calculate P(x,y). Can someone explain it to me please?

2. Originally Posted by continously confused
I'm just very confused about conditional density function. like the question is to show that Ey[E(X|Y)] = E(X)

x=0 x=1 x=2 x=3
y = 0 o.o4 o.o5 o.o6 o.o7
y=1 o.o6 o.o8 o.o7 o.o9
y=2 o.1 o.11 o.13 o.14

well i think that E(X) is
0x.04 + 0x.06 + 0x.1 + 1x.05 + 1x.08 + 1x.11 + 2x.06 + 2x.07 + 2x.13 + 3x.07 + 3x.09 + 3x.14 = 1.66

and that E(X|Y) = P(x,y)/P(y) this is p(x|y) not E(X|Y)

but the thing is that i dont know how to calculate P(x,y). Can someone explain it to me please?
Is that p(x,y)?

3. yeahh it is, but the thing is i really dont understand what my p(x,y) is supposed to be.. like is it just one number? like the row totals or something?

Originally Posted by matheagle
and that E(X|Y) = P(x,y)/P(y) this is p(x|y) not E(X|Y)

ohhh and umm im really dumb, so what is the difference between p(x|y) and E(X|Y)? what is it meant to be? thanks

4. YOUR table is hard to read, but it looks like all the numbers add to one.
SO, that is p(x,y). For example P(X=0,Y=0)=.04....
P(X=0|Y=0)=P(X=0,Y=0)/P(Y=0).

Y can be 0,1,2 so there are 3 values for E(X|Y=y), depending on y

$\displaystyle E(X|Y=0)=\sum_{x=0}^3 xP(X=x|Y=0)$

5. ahhh icic thank you. :]. but how do i show that Ey[E(X|Y)] = E(X)?
do i just do:

$\displaystyle E(X|Y=0)=\sum_{x=0}^3 xP(X=x|Y=0)$
$\displaystyle E(X|Y=1)=\sum_{x=0}^3 xP(X=x|Y=1)$
$\displaystyle E(X|Y=2)=\sum_{x=0}^3 xP(X=x|Y=2)$

6. $\displaystyle E(X)=\sum_x\sum_y xp(x,y)$

YOU need to be careful with that y in

$\displaystyle E(E(X|Y))=\sum_y E(X|Y=y))P(Y=y)$

Just consider E(X|Y=y)) as g(y) and

$\displaystyle E(g(Y))=\sum_y g(y) P(Y=y)$

7. ahhh okies, thank you!!