469,616 Members | 1,792 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,616 developers. It's quick & easy.

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
that is made terrible by our own mad attempt to interpret it as though it had
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.

Similar topics

7 posts views Thread by nitro | last post: by
reply views Thread by jantod | last post: by
2 posts views Thread by Aage Andersen | last post: by
2 posts views Thread by robert | last post: by
2 posts views Thread by Chris Smith | last post: by
18 posts views Thread by robert | last post: by
4 posts views Thread by HYRY | last post: by
1 post views Thread by 1960_j | last post: by
1 post views Thread by dingo_1980 | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.