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)$.
Integrating a probability density function
-
0@DilipSarwate How do you numerically integrate the function that I gave to find P(x
$\sigma \sqrt{2\pi}$ – 2012-06-05 -
0Do like suggested, at the end multiply answer obtained by $\sigma\sqrt{2\pi}$. – 2012-06-05
1 Answers
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.
-
0I 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$ ... – 2012-06-06
-
0You 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? – 2012-06-06
-
0Ok 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 ? – 2012-06-06
-
0"Does this have any signification ?" Yes. – 2012-06-06
-
0Yes, Which is ? – 2012-06-06
-
0The signification as you call it is that the probability that **any** normal random variable (with non-zero variance, to avoid trivial exceptions) exceeds _its_ mean $\mu_X$ by one of _its_ standard deviation $\sigma_X$ has value $1-\Phi(1)$. So you can make different choices of $\mu$ and $\sigma$ and torture a computer into doing repeated numerical integrations with different numbers, but you will get the _same_ value $1-\Phi(1) \approx 0.1587$ for $P\{X > \mu_X + \sigma_X\}$. – 2012-06-06