I have difficulties computing the following conditional expectation: $$E[\max \{Y_1,r\}|Y_1 < x]$$ the CDF of $Y_1$ is G(`).
I browse other questions that deal with only one part of the conditional expectation, for instance, the expectation of max given min, or expectation of y given y<x. But I still find difficult to compute this one.
My thought is to separate this into 2 parts and add them by probability: $$P(Y_1 \leq r)E[r|Y_1 < x]+P(Y_1>r)E[Y_1|Y_1 < x]=G(r)r+(1-G(r))[r+\frac{1}{G(x)}\int_{r}^{x}yf(y)dy ]$$ Rearrange I get: $$(1-G(r))[\frac{1}{G(x)}\int_{r}^{x}yf(y)dy]+r$$
But the correct answer is: $$r\frac{G(r)}{G(x)}+\frac{1}{G(x)}\int_{r}^{x}yf(y)dy$$
Can anyone tell me where I'm wrong and the right way to deal with this?
Thank you so much!
$$ E[max\{Y,r\} | Y<x] = \int_{-\infty}^{+\infty} max\{y,r\}f_Y (y|y<x)dy = \int_{-\infty}^{r} rf_Y (y|y<x)dy + \int_{r}^{x} yf_Y (y|y<x)dy $$
Now just let's figure out what is the new density function. Since the sample space is reduced, the density function for y values which are less than x must be scaled properly. Let the new function be called
$$ g\left(y\right) = \left\{ \begin{array}{lr} a(x)f_Y(y) & y<x\\ 0 & otherwise \end{array} \right.\\ $$
We know that $ \int_{-\infty}^{+\infty}g(y)dy = 1 $
$$ \int_{-\infty}^{+\infty}g(y)dy = \int_{-\infty}^{+x}a(x)g(y)dy = a(x)\int_{-\infty}^{+x}f_Y(y)dy = a(x)G(x) = 1$$ So we have $ a(x) =\frac{1}{G(x)} $ $$ g(y) = f_Y(y|y<x) = \frac{f_Y(y)}{G(x)} $$
Returning to the integrals we have $$ E[max\{Y,r\} | Y<x] = r\int_{-\infty}^{r} \frac{f_Y(y)}{G(x)}dy + \int_{r}^{x} y\frac{f_Y(y)}{G(x)}dy = r\frac{G(r)}{G(x)} + \int_{r}^{x} y\frac{f_Y(y)}{G(x)}dy $$