Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let the pdf defined as: $P(x, \bar{x}, \sigma) = \exp\left(\frac{-(x-\bar{x})^2}{2\sigma^2}\right)$. How can we integrate this probability density for some values of $x$ that are higher than a given value $y$ ? That is computing $P(x>y)$.

share|cite|improve this question
@DilipSarwate How do you numerically integrate the function that I gave to find P(x<y) ? It is not the true normal distribution, it is proportinal to it, since I dont normalize on $\sigma \sqrt{2\pi}$ – shn Jun 5 '12 at 21:16
Do like suggested, at the end multiply answer obtained by $\sigma\sqrt{2\pi}$. – André Nicolas Jun 5 '12 at 21:49
up vote 0 down vote accepted

What you claim to be a probability density function is in fact not a probability density function, and its integral will not give you a probability. $$\begin{align*} \int_y^{\infty}\exp\left(\frac{-(x-\bar{x})^2}{2\sigma^2}\right)\;\mathrm dx &=\sigma\sqrt{2\pi}\int_y^{\infty}\frac{1}{\sigma\sqrt{2\pi}}\exp\left(\frac{-(‌​x-\bar{x})^2}{2\sigma^2}\right)\;\mathrm dx\\ &=\sigma\sqrt{2\pi}\left[1-\Phi\left(\frac{y-\bar{x}}{\sigma}\right)\right] \end{align*}$$ where the value of $\Phi(\cdot)$ can be looked up in a table.

If you must write a computer program to compute (an approximation to) the value of the integral via explicit numerical integration, try some of the programs available in various computer languages at this site. Alternatively, if it is not a requirement that explicit numerical integration must be used, the approximate value of $\Phi(x)$ can be computed using the rational function approximations given in Section 26.2 of Abramowitz and Stegun. These approximations are used in most "scientific" calculators and even in MATLAB and similar packages. But if even greater accuracy is required, more accurate values can be obtained by summing the first few terms of one of the series for $\Phi(x)$ that are given in Chapter 26 of Abramowitz and Stegun. These methods are likely to be less time-consuming than explicit numerical integration.

share|cite|improve this answer
I don't need a hight precision so, where is the table that can directly give me the value if $\phi(.)$ given y, $\bar{x}$ and $\sigma$ ? I only found tables for the standard normal distribution where $\bar{x}=0$ and $\sigma=1$ ... – shn Jun 6 '12 at 12:23
You mean you are incapable of subtracting $\bar{x}$ from $y$, dividing by $\sigma$ and using the numerical value of $(y-\bar{x})/\sigma$ that you just computed in the table for the standard normal distribution? Have you ever given any thought to how many different tables would be needed if you were wanting a different table for every possible choice of $y$, $\bar{x}$ and $\sigma$ that you might ever encounter? – Dilip Sarwate Jun 6 '12 at 13:37
Ok I've found a program code to compute the CDF of standard normal distribution, then I scale to the mean and sigma that I want, as you said. However, sometimes when I compute P( x > mean1+sigma1 ) for the normal(mean1, sigma1), and then recompute the P( x > mean2+sigma2 ) for the for the normal(mean2, sigma2), it always gives the same probability value ! Even if I try with other slightly different values of mean and sigma. Does this have any signification ? – shn Jun 6 '12 at 15:08
"Does this have any signification ?" Yes. – Dilip Sarwate Jun 6 '12 at 15:59
Yes, Which is ? – shn Jun 6 '12 at 16:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.