E[E[Y|X]]

Discussion in 'CS1' started by ykai, Mar 12, 2023.

  1. ykai

    ykai Ton up Member

    Why E[E[Y|X]]=sum E[Y|X]*p(x)?

    When we calculate E[Y|X], we calculate sum y*p(x,y)/p(x).
    It means y multiply conditional probability p(x|y).

    Why E[E[Y|X]] not E[Y|X]*p(y)?
    Why the probability of E[Y|X] is p(x)?
    I think it should be p(y), because the object of expected value should be Y like E[Y|X],shouldn't it?
    How can it become X?
     
    Last edited: Mar 12, 2023
  2. CapitalActuary

    CapitalActuary Ton up Member

    Perhaps notation is getting you bogged down a bit here.

    When you write E[E[Y|X]], the two expectations are being taken over different variables. The inner expected value E[Y|X] is being taken over Y, and the outer expected value is being taken over X.

    This is because E[Y|X] is a random variable in terms of X. i.e. we can write the expected value of Y for a particular value of X as E[Y|X=x], which is clearly a function of x. Indeed we can define f(x)=E[Y|X=x]. Then the random variable E[Y|X] is f(X). So when we write E[E[Y|X]] this is E[f(X)], which is clearly an expectation with respect to different values X can take.

    Hope that clears things up.
     
    ykai likes this.
  3. ykai

    ykai Ton up Member

    Thank you!It is super clear!
     

Share This Page