[Math] Conditional mean and variance of normal random variables

conditional probabilityexpectationintegrationnormal distributionprobability

There are two independent normal random variables $N_1, N_2$ with means $\mu_1, \mu_2$ and variances $\sigma_1^2, \sigma_2^2$ respectively.

Is there a way to compute the two conditional expressions

$$ \mathbf{E}[ N_1 \mid N_1 > N_2 ] $$
$$ \mathbf{Var}[ N_1 \mid N_1 > N_2 ] $$

by rewriting them in the form of other common functions (i.e. those that may be already implemented in typical numerical libraries) without evaluating the entire double integral that would be the direct approach? Alternatively, is there a closed form expression for the integral?

Best Answer

Let us start with some simple cases.

First case: Assume that $Z$ is normal $(\mu,\sigma^2)$, then $Z=\mu+\sigma U$ where $U$ is standard normal hence $E[Z\mid Z\gt0]=\mu+\sigma E[U\mid U\gt-\mu/\sigma]$. Furthermore, since $U$ is standard normal, for every $u$, $P[U\gt-u]=P[U\lt u]=\Phi(u)$ and $$ E[U;U\gt-u]=\int_{-u}^\infty s\varphi(s)\mathrm ds=\left.-\varphi(s)\right|_{-u}^\infty=\varphi(u), $$ where $\varphi$ and $\Phi$ are the standard normal PDF and CDF, respectively. Hence $$ E[Z\mid Z\gt0]=\mu+\sigma\varphi(\mu/\sigma)/\Phi(\mu/\sigma)=\sigma\psi(\mu/\sigma), $$ where, for every $u$, $$ \psi(u)=u+\varphi(u)/\Phi(u). $$ Second case: Assume that $T$ is normal $(\nu,\tau^2)$ independent of $Z$, then $$ E[T\mid Z\gt0]=E[T]=\nu. $$ General case: Consider $Z=N_1-N_2$, then $(\mu,\sigma^2)=(\mu_1-\mu_2,\sigma_1^2+\sigma_2^2)$. Our task is to find some normal random variable $T$ independent of $Z$ such that $N_1$ is a linear combination of $Z$ and $T$. Note that $T=\sigma_2^2N_1+\sigma_1^2N_2$ is independent of $Z$ and normal $(\nu,\tau^2)=(\sigma_2^2\mu_1+\sigma_1^2\mu_2,2\sigma_1^2\sigma_2^2)$, and that $(\sigma_1^2+\sigma_2^2)N_1=\sigma_1^2Z+T$. Hence, $$ (\sigma_1^2+\sigma_2^2)E[N_1\mid Z\gt0]=\sigma_1^2E[Z\mid Z\gt0]+E[T\mid Z\gt0], $$ that is, $$ (\sigma_1^2+\sigma_2^2)E[N_1\mid N_1-N_2\gt0]=\sigma_1^2\sigma\psi(\mu/\sigma)+\nu. $$ And for the variances? The same decomposition proves useful, since $$ E[(\sigma_1^2Z+T)^2\mid Z\gt0]=\sigma_1^4E[Z^2\mid Z\gt0]+2E[T] E[Z\mid Z\gt0]+E[T^2], $$ that is, $$ E[(\sigma_1^2Z+T)^2\mid Z\gt0]=\sigma_1^4E[Z^2\mid Z\gt0]+2\nu\sigma\psi(\mu/\sigma)+\tau^2+\nu^2, $$ A new term to be computed is $$ E[Z^2\mid Z\gt0]=\mu^2+2\mu\sigma E[U\mid U\gt-u]+\sigma^2E[U^2\mid U\gt-u], $$ with $u=\mu/\sigma$, that is, $$ E[Z^2\mid Z\gt0]=\sigma^2(u^2+2u\psi(u)+E[U^2\mid U\gt -u]). $$ An integration by parts yields $E[U^2\mid U\gt -u]=\Phi(u)-u\varphi(u)$, hence one can put everything together and conclude.