I have a sample in normal distribution, with known average ($\mu$) and deviation ($\sigma$). As it is known, its probability density function is $f=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$.
However, what I need to say, that is the probability of that a given value is above (or below) a randomly selected element of the sample.
On this reason, what I would need, that is the inverse of the integrate of f. Already the integrate of f is not analytical ($e^{-x^2}$ has only definite integrals, as far I know).
And, it is yet more worse. I would actually need to approximate it, and ideally quickly1 and well2.
What is a good approximation3 of the inverse of the integrate of $f$?4
1O(1)
2The iteration steps approximate exponentially or yet more quicker the real value.
3"good approximation": usually used in practical mathematical statistics problems, if the applied software environment can not do that
4$(\int f)^{(-1)}$
qnormin R,scipy.stats.norm.ppfin Python, even Excel has it inNORMSINV). So for practical use you'll best rely on an existing implementation. If you really need to roll out your own implementation, exploring the source code should be instructive AND/OR provide references for the specific algorithm used. $\endgroup$qnorm, there is a bit of boundary checking but once you get to line ~80 it's pretty much self-contained. (I recently did something similar and trust me, it gets much more complicated than this for e.g. $\chi^2$ or $\Gamma$) $\endgroup$