For a normally distributed random variable X with mean mu and variance sigma^2, what is the conditional expectation E[X|X>0]?
I know that if mu is 0 then it is: \[\sqrt{\frac{2}{\pi}}\sigma\]
Essentially, I have: \[\huge\frac{\frac{1}{\sqrt{2\pi\sigma^2}}\int_{x=0}^\infty x*e^{-\frac{(x-\mu)^2}{2\sigma^2}}dx}{\frac{1}{\sqrt{2\pi\sigma^2}}\int_{x=0}^\infty e^{-\frac{(x-\mu)^2}{2\sigma^2}}dx}\]
Because I have a closed form of the CDF of zero, I can resolve the denominator to: \[1-\frac{1}{2} \left( 1+erf\left(\frac{-\mu}{\sqrt{2\sigma^2}}\right)\right) \]
I don't see a nice form when \(mu\) is not given
WLOG, I can assume sigma is 1.
You've already discovered the answer: Conditional expectation E[X|X>0] = (integrate PDF(x) * x from x = 0 to infinity), then normalize by dividing by (integrate PDF(x) from x = 0 to infinity). What more do you need done? I'm guessing you're looking for a closed-form solution?
Yes, exactly.
So I am thinking I can assume sigma is one and then think of x and mu in terms of multiples of sigma. Then Wolfram Alpha seems to give me this:\[\large E[X|X>0]=\frac{\sqrt{\frac{2}{\pi}}\left( e^{-\frac{\mu^2}{2}}+\sqrt{\frac{\pi}{2}} \mu \left(erf(\frac{\mu}{\sqrt{2}})+1\right)\right)}{erf(\frac{\mu}{\sqrt{2}})+1}\]Does this seem best?
I guess that looks better as \[\large\mu+\frac{\sqrt{\frac{2}{\pi}}\left(e^\frac{-\mu^2}{2}\right)}{erf(\frac{\mu}{\sqrt{2}})+1}\]
Ooh! Then I can build sigma back in: \[\large\mu+\frac{\sqrt{\frac{2\sigma^2}{\pi}}\left(e^\frac{-\mu^2}{2\sigma^2}\right)}{erf(\frac{\mu}{\sqrt{2\sigma^2}})+1}\]
Join our real-time social learning platform and learn together with your friends!