Probability – Expected Value of Normal Distribution Given Positive Distribution

normal distributionprobabilityprobability distributions

Given $X \sim N(0, \sigma^2)$ (that is, $X:\mathbb{R} \to \mathbb{R}$ is a normal random variable with mean $0$ and variance $\sigma^2$), I'm trying to calculate the expected value of $X$ given that $X>0$. I thought that integrating
$$
\int_{0}^{\infty} x\cdot \frac{1}{\sqrt{2 \pi \sigma^2}} e^{-\frac{x^2}{2\sigma^2}}dx
$$
would do it, but the value, $\frac{\sigma}{\sqrt{2\pi}}$, seems to be off by a factor of 2 based on some other information I have; I think the answer should be $\sqrt{\frac{2}{\pi}}\sigma$.

Question: How should the expected value of $X$, given that $X>0$, be computed?

Best Answer

Let $f(x)$ be the density of $X$; let $F(x)$ be its CDF.

Then the density of $X$, conditional on it being positive, is $f(x)/P(X \ge 0)$ if $x \ge 0$, and $0$ otherwise.

Of course $P(X \ge 0) = 1/2$ by symmetry, so the density of $X$ conditional on $X \ge 0$ is $2f(x)$ (on $x \ge 0$).

So you need to do the integral $$ \int_0^\infty 2xf(x) \: dx $$ which is twice the integral you've written.