scipy/numpy inverse cumulative normal

Robert Kern robert.kern at gmail.com
Sat Apr 8 14:25:06 EDT 2006


bartsimpson8882002 at yahoo.com wrote:
> I was wondering if scipy/numpy has the inverse cumulative normal 
> function, ie the function f in this expression
> 
> f(scipy.stats.norm.cdf(1.2)) = 1.2
> 
> or more generally, a function f which fits the criteria
> 
> f(scipy.stats.norm.cdf(x)) = x

Look in the file where all of the distributions are defined,
Lib/stats/distributions.py . You will find that each distribution object also
has a method call .ppf(), the Percent Point Function, the inverse of the CDF.

In [1]: from scipy.stats import norm

In [2]: norm.ppf(norm.cdf(1.2))
Out[2]: array(1.2000000000000004)

> There is a distribution called invnorm, but I am not sure of how to use
> it.

invnorm is another probability distribution entirely. Don't bother with it.

-- 
Robert Kern
robert.kern at gmail.com

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list