469,616 Members | 1,792 Online

# scipy/numpy inverse cumulative normal

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

There is a distribution called invnorm, but I am not sure of how to use
it.
Apr 8 '06 #1
2 12861
ba****************@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
ro*********@gmail.com

"I have come to believe that the whole world is an enigma, a harmless enigma
an underlying truth."
-- Umberto Eco

Apr 8 '06 #2
In article <ma***************************************@python. org>,
ro*********@gmail.com says...
ba****************@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.

Great thanks very much. Exactly what I was looking for. And seeing the
scipy.info for ppf, that's exactly what it says as well. Got distracted
by the invnorm distribution :-(
Apr 10 '06 #3

### This discussion thread is closed

Replies have been disabled for this discussion.