# Expected value conditional on a function

Let $X$ and $Y$ be random variables. What is the relationship (if any) between $E[Y|X]$ and $E[Y|g(X)]$?

I have been trying to Google or look in books but I'm having trouble even articulating this properly. Any insight would be greatly appreciated.

• I'm not sure if much can be said in general. For example, if $g(x) = c$ for some constant $c$, then we don't learn anything by observing $g(X)$. Commented Sep 8, 2018 at 0:31
• One of the particular cases I'm interested in has $X$ be a random vector of dimension $k$ and $g(X) = X'a$, where $a \in \mathbb{R}^k$. In this setting $g$ is not constant but it is not one-to-one. I was able to find in the Wikipedia page for conditional expectations that $E[E[Y|X]|g(X)] = E[Y|g(X)]$, although I'm not sure how to prove it. I wonder if this is as much as can be said in general. Commented Sep 10, 2018 at 20:36

P(Y=y \& g(X)=g(a)) =P(Y=y | g(X)=g(a))P(g(X)=g(a))\\ \begin{align} &=P(Y=y \& g(X)=g(a) \& X=a)+ P(Y=y \& g(X)=g(a) \& X \neq a) \\&=P(Y=y \& X=a)+ P(Y=y \& g(X)=g(a) \& X \neq a) \\&=P(Y=y | X=a) P(X=a)+ P(Y=y | g(X)=g(a) \& X \neq a)P(g(X)=g(a) \& X \neq a) \end{align}

And we get this when $P(g(X)=g(a)) \neq 0$. : $P(Y=y | g(X)=g(a))=P(Y=y | X=a) r +P(Y=y | g(X)=g(a) \& X \neq a)(1-r)$

where $r= P(X=a)/P(g(X)=g(a))$.

$\int y f_{Y|g(X)=g(a)} dy= r \int y f_{Y|X=a} dy+ (1-r) \int y f_{Y|g(X)=g(a) \& X \neq a}dy$

$E[Y|g(X)=g(a)]= r E[Y|X=a] +(1-r)E[Y|g(X)=g(a) \& X \neq a]$

When g is a one-to-one function, r would be 1 so they are equal. I guess this equation could be related to Bayesian statistics.

I posted misleading answer before and now I improved it and post it again. Any advice and crrections are always welcome. I am also a studying student.

• Your notation is vague and therefore leads easily to misinterpretation: sometimes you seem to use "$x^{*}$" (which you don't actually define) in the sense of the inverse image $\{x\mid g(x)=g^{*}\}$ and other times it seems to denote some particular element of that set. Could you edit this answer to clarify what you're trying to say?
– whuber
Commented Sep 7, 2018 at 14:06
• Sorry for misleading answer. I was trying to say one specific value of the function $g$ as a $g*$. I will edit this answer now. Thank you for your comment.
– KDG
Commented Sep 7, 2018 at 14:20
• That clarifies things--but it makes it evident your first equation is wrong, because it implicitly assumes $g$ is one-to-one.
– whuber
Commented Sep 7, 2018 at 15:48
• You're right. I will delete my answer to avoid confusion. I am so sorry.
– KDG
Commented Sep 8, 2018 at 0:01
• I had improved this answer so I didn't delete it.
– KDG
Commented Sep 10, 2018 at 7:50