# Are $E_{Y|X}[Y]$ and $E_{Y|X}[Y|X]$ equivalent?

I am under the impression that:

$$E_{Y|X}[Y] = E_{Y|X}[Y|X] = \int y f_{y|X}(y|X) dy$$

And by extension:

$$f_{y|X}(y) = f_{y|X}(y|X)$$

Please correct me if I am wrong. Thank you! I understand that notation like this is dependent on whatever the author intends, so I am mostly hoping to ask for what convention you have all seen most commonly.

Here are some places where I've seen notation like this:

(Here $$|X$$ is in the subscript only, but the author seems to intend for $$E[Y|X=x] = E_{Y|X}[Y]$$)

(Here $$|X$$ is in both the subscript and the argument)

• Welcome to CV. Please provide definitions of each of your types of expectation, because that's essential information for answering this question. Although the "$E[\ \mid\ ]$" notation is standard, the subscripts are generally superfluous. A good textbook will provide a definition of $E[X\mid Y]$ that needs no subscripts. Subscripts might be employed by careful writers when there are other random variables referenced in the arguments to make the meaning clearer.
– whuber
May 23 at 15:24
• @whuber I see, thank you. My professor used these subscripts during lectures and simply said to refer to earlier statistics courses when asked for clarification. May I ask if, from your experience, $E[Y|X]$, $E_{Y|X}[Y]$, and $E_{Y|X}[Y|X]$ all could refer to the same integral? May 23 at 15:39

These notations with subscripts are an abomination used only by people who don't know better.

There are conditional probabilitites, and hence conditional probability distributions and one can speak of $$\operatorname E(X\mid A)$$ where $$X$$ is a random variable and $$A$$ is an event.

The event in question may be that a particular random variable has a particular value, and then one can write $$\operatorname E(X\mid Y=y),$$ where $$Y$$ is a random variable and $$y$$ is any of the values it can take.

This conditional expected value, $$\operatorname E(X\mid Y=y),$$ depends on what number $$y$$ is, so one may write $$\operatorname E(X\mid Y=y) = h(y).$$ In that case, one can define $$\operatorname E(X\mid Y)=h(Y),$$ and that is a random variable in its own right, and is determined by the value of the random variable $$Y$$. Its expected value is the same as the expected value of $$X,$$ so we have $$\operatorname E(\operatorname E(X\mid Y)) = \operatorname E(X).$$

Often one sees $$\displaystyle \int_S f_{X\,\mid\,Y} (x\mid y) \, dx$$ but I think the notation $$\displaystyle \int_S f_{X\,\mid\,Y=y} (x)\, dx$$ is better.

Those a good notations; the subscripts of which you write are nonsense.

• Thanks! Your explanations are very clear. It is tough for me because I am in multiple computer science related courses that involve probability and expected values, but all the professors seem to be using different subscript notations... May 24 at 17:27