1. ## Conditional expectation

Hi !

Okay, this problem has been bugging me... I guess I have some problems with conditional things

Let X and Y two independent rv's, both following a uniform distribution over [0,1]
Define $\displaystyle Z=\max\{0,Y-X\}$

Find the conditional expectation $\displaystyle \mathbb{E}[Z|X]$. Then find the conditional distribution of Z such that X=x.

hem... I was thinking about splitting the expectation and keeping the part where Y>X (since it's 0 elsewhere).
But I'm drawing a blank there

Also, is it more logical to first find the conditional distribution before the conditional expectation ?
And would someone be kind enough to give me the general guidelines when dealing with such a problem ?

Thanks for any help !

2. Originally Posted by Moo
Hi !

Okay, this problem has been bugging me... I guess I have some problems with conditional things

Let X and Y two independent rv's, both following a uniform distribution over [0,1]
Define $\displaystyle Z=\max\{0,Y-X\}$

Find the conditional expectation $\displaystyle \mathbb{E}[Z|X]$. Then find the conditional distribution of Z such that X=x.

hem... I was thinking about splitting the expectation and keeping the part where Y>X (since it's 0 elsewhere).
But I'm drawing a blank there
It is the correct idea. Like: we have $\displaystyle Z=(Y-X){\bf 1}_{(Y>X)}$, hence $\displaystyle E[Z|X]= E[(Y-X){\bf 1}_{(Y>X)}|X]$. And to compute this expectation, you consider $\displaystyle X$ as a constant, and integrate with respect to the distribution of $\displaystyle Y$ (given $\displaystyle X$), which is uniform on $\displaystyle [0,1]$ (because $\displaystyle X$ and $\displaystyle Y$ are independent). Thus, you can write $\displaystyle E[Z|X]=\int_0^1 (y-X){\bf 1}_{(y>X)}dy = \int_X^1 (y-X) dy$ etc. Perhaps you would prefer writing $\displaystyle E[Z|X=x]$ and use little x afterward; sometimes this avoids confusion.

Also, is it more logical to first find the conditional distribution before the conditional expectation ?
It depends, just like usual expectation. Sometimes it is much shorter to find the conditional expectation. Sometimes (like in cases with densities), it is however simpler to give the conditional distribution, because the cond. expec. requires the cond. distr. and needs an extra integration.

By the way, it is possible to deduce the definition of conditional expec. from that of the conditional distr. (but the existence of conditional distributions is very delicate), and it is also possible to define conditional exp. only. (there are several simpler proofs of existence).

If $\displaystyle (X,Z)$ has a density $\displaystyle f_{(X,Z)}$ and you need the law of $\displaystyle Z$ given $\displaystyle X$, you know the formula for that ($\displaystyle f_{Z|X=x}(z)=\frac{f_{(X,Z)}(x,z)}{f_X(x)}$).

If $\displaystyle X$ is discrete, you may condition by $\displaystyle \{X=x\}$, hence no specific problem.

In other cases, you can procede along the definition: if, for all measurable $\displaystyle g:\mathbb{R}\to\mathbb{R}_+$, $\displaystyle E[g(Z)]=\cdots = \int E[g(Y_x)] d\mu_X(x)$ (for some family of r.v. $\displaystyle Y_x$, $\displaystyle x\in \mathbb{R}$), then the conditional law of $\displaystyle Z$ given $\displaystyle X=x$ is the law of $\displaystyle Y_x$. This may get messy.

In the present case, the easiest way is definitely to compute the conditional distribution function. For all $\displaystyle 0\leq t\leq 1$, $\displaystyle P(Z<t|X)=P(Z=0|X)+P(0<Y-X<t|X)=\cdots$. Compute the expectations depending on $\displaystyle (X,Y)$ by considering $\displaystyle X$ as a constant (because of the independence).

In other situations, a conditional characteristic function could be used as well. Or a conditional moment generating function, or whatever suits better... Any tool for finding distributions, as long as the computations are manageable.

Finally, you can check your work by computing the cond. expectation from the cond. distribution.

3. Okay, thanks for your explanations
Yes, we use first X=x, then transform it into X.

There are some stuff we didn't study yet (and we've finished the conditional part of the class)

This is what we did today, basically :
1/ There's a property that says that for any (well defined) function $\displaystyle \varphi$, and if X and Y are independent, $\displaystyle \mathbb{E}[\varphi(X,Y)\mid X=x]=\mathbb{E}[\varphi(x,Y)]$

which gives what you did.

2/ For the conditional distribution, since X and Y are independent, a property says that the conditional distribution of $\displaystyle \varphi(X,Y)$ given X=x is the distribution of $\displaystyle \varphi(x,Y)$
And then we compute the distribution of this new rv.

3/ If we know the conditional distribution of, let's say Y given X=x, we can compute $\displaystyle \mathbb{E}[f(Y) \mid X=x]$ for any function f that is bounded or positive (that's what we're told...)
So it's not immediate to get the conditional expectation from it, since the identity function is not bounded or positive in any case.
So we have to refer to 1/ in this case.

Looks a bit complicated, but strangely, I understand it better when there are a lot of properties rather than learning intuitive stuff... But I mostly understand what you wrote Again thanks !

4. Originally Posted by Moo
3/ If we know the conditional distribution of, let's say Y given X=x, we can compute $\displaystyle \mathbb{E}[f(Y) \mid X=x]$ for any function f that is bounded or positive (that's what we're told...)
So it's not immediate to get the conditional expectation from it, since the identity function is not bounded or positive in any case.
So we have to refer to 1/ in this case.
As you guess, I don't quite agree with that... By definition, $\displaystyle \mathbb{E}[f(Y) \mid X=x]$ is the expectation of $\displaystyle f$ with respect to some probability measure, namely the conditional distribution of $\displaystyle Y$ given $\displaystyle X=x$. Therefore the same restrictions apply as for any expectation: as soon as $\displaystyle E[|f(Y)|\, |X=x]<\infty$ or $\displaystyle f(Y)\geq 0$, we may define $\displaystyle E[f(Y)\mid X=x]$. (By separating positive and negative parts of $\displaystyle f$ in the first case)

Anyway, in the present situation, $\displaystyle 0\leq Z\leq 1$ so that both restrictions are fulfilled!

By the way, when you define $\displaystyle E[Y|X=x]$ directly, you also require something about $\displaystyle Y$, like being integrable, or positive.
Looks a bit complicated, but strangely, I understand it better when there are a lot of properties rather than learning intuitive stuff...
Not so strange, I'm just like you, however I thought you had the "formal properties" part already...

Ciao,
Laurent.