# How do I calculate expected value of partial normal distribution?

Suppose you have a normal distribution with mean=0, and stdev=1. So the expected value is 0.

Now suppose you limit the outcomes, such that no values can be below 0. So 50% of values now equal 0, and rest of distribution is still normal. Running 1000000 trials, I come out with an expected value of .4

My question is how can I get this expected value through calculation?

Thanks

The normal distribution has density function $f(x)=\frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}$; your new distribution has that density function on the positive reals, $P(0)=\frac{1}{2}$, and $P(x)=0$ for the negative reals. The expected value is $0\cdot\frac{1}{2}+\int_{0}^{\infty}x\cdot f(x)dx=\frac{1}{\sqrt{2\pi}}\approx0.398942$.

edit: If you were to cut off at $x=c$ (assigning all the probability from below c to c itself) instead of $x=0$, your density function would be $f(x)=\frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}$ for $x>c$, $P(c)=\int_{-\infty}^{c}\frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}dx$, and $P(x)=0$ for $x<c$, so the expected value is $c\cdot P(c) + \int_{c}^{\infty}x\cdot \frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}dx$.

edit 2: note that the exponent on e in all of the above is $-\frac{x^2}{2}$ (the exponent 2 on the x is, in the current TeX rendering, positioned and sized such as to be somewhat ambiguous)

edit 3: my explanation incorrectly mixed probability density functions and literal probabilities--this was solely an issue of terminology and the analytic results still stand, but I have attempted to clarify the language above.

• How about if instead of just saying all negative values are 0, say all values below y are zero. what would the formula be for that? – CptanPanic Jul 31 '10 at 20:53
• @CptanPanic: I added the case where the cutoff is somewhere other than 0 to my answer (easier to put math stuff/TeX in there than in a comment). – Isaac Jul 31 '10 at 21:04
• I am trying to compute the values, and am having some problems. In the first part with c=0, I don't understand how you got 1/sqrt(2pi). Could you explain? Can you give me a start on how to calculate the integral above that starts at c to infinity? Thanks. – CptanPanic Aug 1 '10 at 13:05
• $\int x\cdot\frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}dx=\frac{1}{\sqrt{2\pi}}\int x\cdot e^{-\frac{x^2}{2}}dx$ (let $u=-\frac{x^2}{2}$ so that $du=-xdx$) $=\frac{1}{\sqrt{2\pi}}\int-e^{u}du=-\frac{1}{\sqrt{2\pi}}e^u+C=-\frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}+C$ – Isaac Aug 1 '10 at 20:01

For the normal distribution: $\mu(1-N(z)+\sigma \cdot n(z)+N(z) \cdot Q$ where $\mu$ and $\sigma$ are the mean and std. dev. of your normal dist., $Q$ is the lower bound (in your case zero), $z=\frac{Q-\mu}{\sigma}$, and $N()$ and $n()$ are the standard normal cdf and pdf respectively.

This can be reversed for upper bounds as well. (see Winkler et al, 1972, "The Determination of Partial Moments".

• Hi, welcome on the MathSE! This site supports Latex, just type in $5\cdot 5$ and you get $5\cdot 5$. – peterh says reinstate Monica May 29 '18 at 19:23