Need help prooving a conditional expectation identity [solved]

144 Views Asked by At

The identity is the following: $E(Y|Z=z) = \int E(Y|Z=z,X=x) P(X=x|Z=z) dx$

I would start by doing:

$E(Y|Z=z) = \int y P(Y=y|Z=z)dy $

and then $$\int y P(Y=y|Z=z)dy=\int y \int P(Y=y|Z=z,X=x) P(X=x) dx \ dy. \ (1)$$

I know this last step is not right since, for the equality to be true, it should be $$\int y P(Y=y|Z=z)dy=\int y \int P(Y=y|Z=z,X=x) P(X=x|Z=z) dx \ dy. \ (2)$$

What's the intuition / steep needed to arrive to the equality number 2?

Thanks in advance

2

There are 2 best solutions below

2
On

Well, assuming you are dealing with probability density functions for continuous random variables (or a generalised sigma-algebra notation), then the Law of Total Probability for conditioned random variables would state:

$$P(Y{=}y\mid Z{=}z) ~{= \int_X P(Y{=}y, X{=}x\mid Z{=}z)~\mathrm d x \\ = \int_X P(Y{=}y\mid X{=}x, Z=z)\,P(X{=}x\mid Z{=}z)~\mathrm d x}$$

As to intuition, it follows closely from the definition of conditional probability for events.   When the sample space is partitioned by sequence of disjoint events, $(B_i)$, then:

$$\mathsf P(A\mid C) ~{= \dfrac{\mathsf P(A\cap C)}{\mathsf P(C)} \\=\dfrac{\mathsf P(A\cap C\cap \bigcup_i \{B_i\})}{\mathsf P(C)}\\=\dfrac{\sum_i \mathsf P(A\cap B_i\cap C)}{\mathsf P(C)} \\=\dfrac{\sum_i \mathsf P(A\mid B_i\cap C)~\mathsf P(B_i\cap C)}{\mathsf P(C)} \\= \sum_i \mathsf P(A\mid B_i\cap C)~\mathsf P(B_i\mid C)}$$


Also

$$P(Y{=}y) ~{= \int_X\int_Z P(Y{=}y, X{=}x, Z{=}z)~\mathrm d z~\mathrm d x \\ = \int_X\int_Z P(Y{=}y\mid X{=}x, Z=z)\,P(X{=}x\mid Z{=}z)\,P(Z{=}z)~\mathrm d z~\mathrm d x}$$

0
On

In order to find the answer intuitively, let's try to use conditional probability in the case of sets first: suppose $\{ B_i\}$ is a partition of the space, then we know that, given two sets $A$, $C$ (disintegration formula) $$\mathbb{P}(A\cap C)=\sum_{i} \mathbb{P}(A \cap B_i \cap C)$$ In particular, if you divide both sides by $\mathbb{P}(C)$, you get $$\mathbb{P}(A\vert C) = \sum_{i} \mathbb{P}(A\cap B_i\vert C).$$ Then, if $A$ is the event $\{Y=y\}$, $C$ is the event $\{Z=z\}$ and you sum over all the possible values of $X$, i.e. you take $B_x=\{X=x\}$, you find (sum becomes expectation) $$\mathbb{P}(Y=y\vert Z=z)=\int \mathbb{P}(Y=y,X=x\vert Z=z)dx$$

Now again by consider events $A$, $B$, $C$ you can see that $$\mathbb{P}(A\cap B\vert C)= \dfrac{\mathbb{P}(A\cap B\cap C)}{\mathbb{P}(C)} = \dfrac {\mathbb{P}(A\cap B\cap C)}{ \mathbb{P}(B\cap C)} \cdot \dfrac{\mathbb{P}(B\cap C)}{\mathbb{P}(C)} = \mathbb{P}(A\vert B\cap C)\mathbb{P}(B\vert C) $$

So in your case we have $$\mathbb{P}(Y=y, X=x \vert Z=z) = \mathbb{P}(Y=y\vert X=x,Z=z)\cdot \mathbb{P}(X=x\vert Z=z)$$ which gives the final step to arrive to (2). Obviously this was all a bit heuristical, you should work with densities instead, but it gives the idea.