Conditional mean of x given y>0 for normal distributions I need to find the conditional expectation of $X$ given $Z>0$ where
 - both $X$ and $Z$ are normally distributed and I know their distributions. In particular they both have mean zero;
 - $Z$ is a function of $X$, in particular it is something like $Z=aX+bY$ where $Y$ is another random variable of which I know the distribution.
I'm stuck because in books I only find $E(X|Z=z)$, but not my problem, which I am not even sure I wrote properly so it would be important to understand whether and how one can find that expectation. Thank you all 
 A: *

*Suppose $X$ and $Y$ are independently and identically normally distributed with mean $0$ and variance $1$.  Then $(X,Y)$ would have a bivariate distribution which has circular symmetry about $(0,0)$

*$Z = aX+bY$ would also be normally distributed with mean $0$ but variance $a^2+b^2$.  The condition $Z \gt 0$ would correspond to points one side of a line $ax+by =0$

*In the special case where $a=1$ and $b=0$, i.e. $Z=X$, the conditional distribution of $X$ given $Z \gt 0$ would be a half-normal distribution with mean $\mathbb E[X\mid Z\gt 0] = \sqrt{\frac{2}{\pi}}$, while we would still have $\mathbb E[Y\mid Z\gt 0]=0$

*but in the more general case the point $(\mathbb E[X\mid Z\gt 0],\mathbb E[Y\mid Z\gt 0])$ would lie on the line $y=\frac ba x$ at a distance $\sqrt{\frac{2}{\pi}}$ from $(0,0)$, i.e. at the point $\left(\sqrt{\frac{2}{\pi}} \frac{a}{\sqrt{a^2+b^2}},\sqrt{\frac{2}{\pi}} \frac{b}{\sqrt{a^2+b^2}}\right)$ so $$\mathbb E[X\mid Z\gt 0]=\sqrt{\frac{2}{\pi}}\frac{a}{\sqrt{a^2+b^2}}$$


This picture may help

To take particular examples confirming my earlier simulations


*

*with $a=1$, $b=2$ you get $\mathbb E[X\mid Z\gt 0] = \sqrt{\frac{2}{5\pi}} \approx 0.35682$

*with $a=1$, $b=1$ you get $\mathbb E[X\mid Z\gt 0] = \sqrt{\frac{1}{\pi}} \approx 0.56419$

*with $a=2$, $b=1$ you get $\mathbb E[X\mid Z\gt 0] = \sqrt{\frac{8}{5\pi}} \approx 0.71365$
