# Subscript notation in expectations

What is the exact meaning of the subscript notation $\mathbb{E}_X[f(X)]$ in conditional expectations in the framework of measure theory ? These subscripts do not appear in the definition of conditional expectation, but we may see for example in this page of wikipedia. (Note that it wasn't always the case, the same page few months ago).

What should be for example the meaning of $\mathbb{E}_X[X+Y]$ with $X\sim\mathcal{N}(0,1)$ and $Y=X+1$ ?

• No doubt someone will chime in with formal definitions, informally, all expectations are expectations over the distribution of (/expectation with respect to) some (possibly multivariate) random variable, whether it has been explicitly specified or left implied. In many cases it's obvious ($\text{E}(X)$ implies $\text{E}_X(X)$ rather than $\text{E}_W(X)$). Other times, it's necessary to distinguish; consider the law of total variance for example: $\text{Var}[Y] = \text{E}_X\left[\text{Var}[Y\mid X]\right] + \text{Var}_X\left[\text{E}[Y\mid X]\right]$. – Glen_b Oct 12 '13 at 11:32
• @Glen_b Is it really necessary to specify in the law of total variance? As $E[Y|X]=f(X)$, for some $f$, isn't it clear that $\text{Var}[E[Y|X]]$ is over $X$? – Thomas Ahle Oct 18 '15 at 17:32
• @ThomasAhle You're quite right -- "necessary" was too strong a word for that example. While strictly speaking it should be clear, it's often a point of confusion for readers unusued to working with it, so it's common, rather than necessary, to be explicit about it. There are some expressions involving expectations where you can't be sure without specifying, but that isn't really one of them – Glen_b Oct 18 '15 at 21:39

In an expression where more than one random variables are involved, the symbol $$E$$ alone does not clarify with respect to which random variable is the expected value "taken". For example

$$E[h(X,Y)] =\text{?} \int_{-\infty}^{\infty} h(x,y) f_X(x)\,dx$$ or $$E[h(X,Y)] = \text{?} \int_{-\infty}^\infty h(x,y) f_Y(y)\,dy$$

Neither. When many random variables are involved, and there is no subscript in the $$E$$ symbol, the expected value is taken with respect to their joint distribution:

$$E[h(X,Y)] = \int_{-\infty}^\infty \int_{-\infty}^\infty h(x,y) f_{XY}(x,y) \, dx \, dy$$

When a subscript is present... in some cases it tells us on which variable we should condition. So

$$E_X[h(X,Y)] = E[h(X,Y)\mid X] = \int_{-\infty}^\infty h(x,y) f_{h(X,Y)\mid X}(h(x,y)\mid x)\,dy$$

Here, we "integrate out" the $$Y$$ variable, and we are left with a function of $$X$$.

...But in other cases, it tells us which marginal density to use for the "averaging"

$$E_X[h(X,Y)] = \int_{-\infty}^\infty h(x,y) f_{X}(x) \, dx$$

Here, we "average over" the $$X$$ variable, and we are left with a function of $$Y$$.

Rather confusing I would say, but who said that scientific notation is totally free of ambiguity or multiple use? You should look how each author defines the use of such symbols.

• I have two questions. 1) Not sure if I understand this properly, can I interpret the expectation as one of the first two equations, if either X or Y has been fixed? 2) Can you give an example for EQ 4 and EQ 5? I have a hard time interpreting them and I think concrete examples would help. Thanks! – ceiling cat Oct 14 '13 at 18:50
• @ceiling cat 1) $E[h(X,\bar y)] = \int_{-\infty}^{\infty} h(x,\bar y) f_X(x)dx$ is correct because essentially you do not have two random variables any more. Likewise for fixing $X$ to $\bar x$. – Alecos Papadopoulos Oct 14 '13 at 19:10
• @ceiling cat 2)-EQ5 : Consider $Z = X^2(Y-(Y+2)^3) = h(X,Y)$. $Z$ is a random variable alright (for an appropriate support). Then using the specific meaning for the short hand notation, $E_X(Z)=E_X[(h(X,Y)] = \int_{-\infty}^{\infty} x^2(y-(y+2)^2) f_{X}(x)dx$ where $f_{X}(x)$ is the density of $X$ (whatever that is). Obviously $Y$ is not integrated, and it will stay intact. But the result you will obtain won't be a number (as in my previous comment), but a random variable (a function of $Y$), since $Y$ here is not fixed, just not-integrated out. – Alecos Papadopoulos Oct 14 '13 at 19:18
• @ceiling cat In both cases in my two previous comments, the "mechanics" of mathematical calculations will be the same. The end results though have different interpretations. – Alecos Papadopoulos Oct 14 '13 at 19:22
• @ceiling cat 2)-EQ4: Consider the same random variable $Z$. Its expected value conditional on $X$ is (using the other meaning for the shorthand notation) $E_X[Z] = E(Z\mid X) = \int_{-\infty}^{\infty} z f_{Z|X}(z\mid x)dz$. Note that here the $x$'s and $y$'s do not appear directly in the integrand -they are "condensed" in the $z$ symbol. – Alecos Papadopoulos Oct 14 '13 at 19:29

I just want to add a follow-up to Alecos' great answer. Sometimes it doesn't matter the exact R.V. (or set of RV) the expectation is over. For instance,

$$E_{X\sim P(X)} [X] = E_{X\sim P(X,Y)}[X]$$

In your particular question, I suspect that because you are given $$h(X,Y)$$ is linear in X and Y, then you will break it up into the "marginal" expectations $$E_X[X]$$ and $$E_X[Y]$$ (and then swap in $$Y = X + 1$$)