0
$\begingroup$

I have been trying to calculate the area under the graph of a PDF (Probability density function) for a normal distribution. The standard form of its PDF is $$\frac{e^{-(x-\mu)^2/2\sigma^2}}{\sqrt{2\pi}\sigma}$$ where $\mu$ is mean and $\sigma$ is standard deviation. The indefinite integral of this is $$\frac{1}{2}\operatorname{erf} \left(\frac{x-\mu}{\sqrt2\sigma}\right)+C$$ where $\operatorname{erf}$ is the error function (https://www.wikiwand.com/en/Error_function) and $C$ is the constant of integration. When I apply the limits from $-\infty$ to $\infty$, Wolfram Alpha is unable to compute it.

How then can I calculate the area under the PDF for the Normal Distribution?

$\endgroup$
2
  • 2
    $\begingroup$ The integral of the whole PDF is of course 1, that's how the normalization constant was selected. As for how to do that analytically, it is a famous problem, look up the Gaussian integral. $\endgroup$
    – Ian
    Feb 16, 2020 at 2:47
  • $\begingroup$ If $f$ is a PDF for a random variable $X$, then $\int_{-\infty}^\infty f(x) \, dx = P( -\infty < X < \infty) = 1$. $\endgroup$
    – littleO
    Feb 16, 2020 at 3:24

3 Answers 3

3
$\begingroup$

$$Q=\int_0^\infty e^{-x^2} dx.$$

$$Q^2 = \int_0^\infty \int_0^\infty e^{-x^2-y^2} dx\,dy= \int_0^\frac{\pi}{2} \int_0^\infty e^{-r^2} r\,dr\,d\theta=\frac{\pi}{4}.$$

$$Q=\frac{\sqrt{\pi}}{2}.$$

A normalized Gaussian will integrate to 1 over the real line. That’s necessary to be a probability distribution.

We can check this.

$$\int_{-\infty}^\infty e^{-p^2} dp = 2Q=\sqrt{\pi}.$$

Let $p=\frac{x-\mu}{\sigma\sqrt{2}}$ so that $dp = \frac{1}{\sigma\sqrt{2}}dx$:

$$\frac{1}{\sigma\sqrt{2\pi}}\int_{-\infty}^\infty e^{-\frac{(x-\mu)^2}{2\sigma^2}} dx =\frac{1}{\sqrt{\pi}}\int_{-\infty}^\infty e^{-p^2} dp = 1.$$

$\endgroup$
0
1
$\begingroup$

By definition, a probability density function must integrate to unity.

Thus, the integral is $1$.

$\endgroup$
5
  • $\begingroup$ This is circular reasoning. You haven't proven your claim that the function is a PDF, you've simply assumed it. $\endgroup$
    – Alex S
    Feb 16, 2020 at 9:30
  • $\begingroup$ It is not circular reasoning. OP acknowledges that they know that the function is a PDF, and PDFs are literally defined to integrate to unity. $\endgroup$ Feb 16, 2020 at 14:29
  • $\begingroup$ Reread his post: "How can I calculate the area under the PDF for the Normal Distribution?". $\endgroup$
    – Alex S
    Feb 16, 2020 at 23:05
  • $\begingroup$ I have read it. They include the word 'PDF,' so what I said stands. $\endgroup$ Feb 16, 2020 at 23:07
  • $\begingroup$ What you're doesn't make any sense. Firstly, he asked how to calculate its area, and you haven't don't that. Secondly, why are we assuming the normal distribution is a PDF? Because the OP said it was? I'd recommend updating your answer to actually prove your claim instead of simply asserting it. $\endgroup$
    – Alex S
    Feb 17, 2020 at 3:58
0
$\begingroup$

Both Wolfram Alpha and Mathematica return the correct answer for an input of $\infty$ in the error function.

$$\textrm{Erf}(x) = \frac{1}{\sqrt{\pi}} \int_{-x}^x e^{-p^2}dp = \frac{2}{\sqrt{\pi} }\int_{0}^x e^{-p^2}dp. $$

enter image description here

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .