If $Y, X, Z$ are random variables, is it true that $E[Y|X=x] = \sum_{z} E[Y|X=x, Z=z]P(Z=z|X=x)$ by law of total expectation?

171 Views Asked by At

If $Y, X, Z$ are random variables. In particular, $Z$ is a positive discrete random variable.

Is it true that $E[Y|X=x] = \sum_{z} E[Y|X=x, Z=z]P(Z=z|X)$ by the law of total expectation/probability?

Here's my attempt:

\begin{align*} E[Y|X=x] &= E[E[Y|X=x, Z]|X]\\ &= \sum_{z} E[Y|X=x, Z=z]P(Z=z|X=x) \end{align*}

1

There are 1 best solutions below

2
On

I am really having trouble to understand your notation. In the following I will try to give a meaning to this equation and provide a counterexample.

From the Doob Dynkin lemma we know that there exist a function $f$ such that \begin{align} \mathbb E\big[Y\big|X,Z\big]=f(X,Z) \end{align} holds. It is common to write $$ f(x,z)=\mathbb E\big[Y\big|X=x,Z=z\big]\,. $$ It looks like by $\mathbb E\big[Y\big|X,Z=z\big]$ you mean \begin{align} \mathbb E\big[Y\big|X,Z=z\big]=f(X,z)\,. \end{align} Likewise, we also know $$\tag{1} \mathbb E\big[Y\big|X\big]=g(X)\quad\text{ where }\quad g(x)=\mathbb E\big[Y\big|X=x\big]\,. $$

Now to the question: It looks like you are asking if $$\tag{2} g(x)=\sum_{z}f(x,z)\frac{\mathbb P(\{Z=z\}\cap\{X=x\})}{\mathbb P\{X=x\}} $$ holds. (This is my only way to give your equation a well defined meaning).

Counter Example

Let $X$ be a discrete random variables taking values in $\{-2,-1,+1,+2\}$ with probability $1/4$ for each. Let $$ Z:=X^2\quad\text{ and }\quad Y:=X^+:=\max(X,0)\,. $$ ($Z$ takes values in $\{1,4\}$ with probability $1/2$ for each. $Y$ takes values in $\{0,1,2\}$ with probability $1/2$ for $0$ and $1/4$ for the other two.)

Further, \begin{align} \mathbb E[Y|X]=Y=X^+\,,\quad g(x)=x^+=1_{\{x=1\}}+2\cdot 1_{\{x=2\}}\,. \end{align} Since $\sigma(Z)\subset\sigma(X)\,,$ $$ \mathbb E\big[Y\big|X,Z\big]=E\big[Y\big|Z\big]\,, $$ that is, $f(x,z)$ does not depend on $x\,,$ only on $z=x^2\,.$

From $\{X=x\}\subset\{Z=x^2\}$ it follows that $$ \frac{\mathbb P(\{Z=z\}\cap\{X=x\})}{\mathbb P\{X=x\}} =\left\{\begin{array}~ \mathbb P\{Z=z\}&\text{ for }z=x^2\,,\\0&\text{ else. }\end{array}\right. $$ Therefore the RHS of (2) contains only two terms, one for $z=1$ and one for $z=4\,:$ $$\tag{3} f(1)\frac{1}{2}+f(4)\frac{1}{2}\,. $$ In particular this does not depend on $x$ while the RHS of (2) is $$\tag{4} g(x)=\left\{\begin{array}~ 1&\text{ for }x=1\,,\\2&\text{ for }x=2\,,\\0&\text{ else }\,.\end{array}\right. $$