# Different formulations of the conditional expectation [duplicate]

Let $$(\Omega, \mathcal{A}, \mathbb{P})$$ be a probability space and $$X: \Omega \rightarrow \mathcal{X}$$ and $$Y: \Omega \rightarrow \mathcal{Y}$$ be random variables.

I have a question comparing the conditional expectations $$\mathbb{E}[Y|X]$$ and $$\mathbb{E}[Y|X=x]$$.

1.) Does $$\mathbb{E}[Y|X=x]$$ mean that $$X$$ is fixed to the value $$x$$? I.e., that it only varies with $$Y$$?

2.) From which space to which spaces do the two conditional expectations map, respectively?

3.) If $$X$$ and $$Y$$ are absolutely continuous real valued random variables and have a joint density $$f_{X, Y}$$ with respect to the (product) Lebesgue-measure $$\lambda \otimes \lambda =\lambda^2$$, that is, $$\mathbb{P}_{X, Y}(B, C)=\int_{B \times C}f_{X, Y}(x, y)\lambda^2(dx, dy)=\int_B \int_C f_{X, Y}(x, y)\lambda(dx) \lambda(dy)$$ with Borel sets $$B$$ and $$C$$. Then:

$$\mathbb{E}[Y|X=x] = \int y \, f_{Y|X=x} \lambda(dy) = \int y \, \frac{f_{X, Y}(x,y)}{f_X(x)}\lambda(dy)$$.

My question is now, how would that equation look like for $$\mathbb{E}[Y|X]$$? Does it make sense to write something like $$f_{Y|X=X}(y)$$ and $$f_{X,Y}(X,y)$$ and do these quantity even exist? I.e., should I write $$\mathbb{E}[Y|X] = \int y \, f_{Y|X=X} \lambda(dy) = \int y \, \frac{f_{X, Y}(X,y)}{f_X(X)}\lambda(dy)$$?

4.) Following the commments under the answer: Under which circumstances do the above formulations of the conditional expectation hold? And how do I compute the conditional expectation if these conditions do not hold, i.e., in the general case?

• (1) By definition, the conditional expectation is a function of the value of $X$--not of $Y.$ (2) You can't define the conditional expectation as you do for continuous variables because $f_X(x)$ is never uniquely defined. You need a more sophisticated approach, that of projection to a sub sigma algebra. I believe stats.stackexchange.com/questions/230545 might answer all your questions.
– whuber
Oct 21, 2021 at 19:38
• Thanks for the link, it is indeed insightful but I dont think it helps me solve all my understanding problems. In the answer, he is talking about an event A. Is X=x also an event? I mean A is a set and X=x is only a number right? Oct 21, 2021 at 20:07
• en.wikipedia.org/wiki/Conditional_expectation in the section "continuous random variables" they define the conditional expectation exactly like I do Oct 21, 2021 at 20:09
• That's an elementary approach intended to avoid the complexities of the measure-theoretic definition. But the language you use suggests you are already beyond such simplifications.
– whuber
Oct 21, 2021 at 21:28
• It is not wrong--it is just not universally applicable.
– whuber
Oct 22, 2021 at 12:34