inverse_normal_distribution()¶
- audmath.inverse_normal_distribution(y)[source]¶
Inverse normal distribution.
Returns the argument for which the area under the Gaussian probability density function is equal to . It returns if .
The area under the Gaussian probability density function is given by:
This function is a
numpy
port of the Cephes C code. Douglas Thor implemented it in pure Python under GPL-3.The output is identical to the implementation provided by
scipy.special.ndtri()
, andscipy.stats.norm.ppf()
, and allows you to avoid installing and importingscipy
.audmath.inverse_normal_distribution()
is slower for large arrays as the following comparison of execution times on a standard PC show.Samples
scipy
audmath
10.000
0.00s
0.01s
100.000
0.00s
0.09s
1.000.000
0.02s
0.88s
10.000.000
0.25s
9.30s
- Parameters
- Return type
- Returns
inverted input
Examples
>>> inverse_normal_distribution([0.05, 0.4, 0.6, 0.95]) array([-1.64485363, -0.2533471 , 0.2533471 , 1.64485363])