# Integrating a probability density function

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)$.

-
@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

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.
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