473,394 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 13598
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: nitro | last post by:
Hi, I am using a Debian system. I installed NumPy and everything works well. When I try to install SciPy, I get the following error. Any help would be appreciated. ===...
0
by: jantod | last post by:
I am trying to package my application with py2exe. Unfortunately it uses both scipy/numpy and numarray so I'm having to jump through a lot of hoops to get it going. I'm getting problems packaging...
2
by: Aage Andersen | last post by:
I am exploring the modules scipy and linalg using python under Win XP and IDLE. Defining m=matrix( .. ) and trying to compute the inverse of m: I get an array: This is unfortunate. I...
2
by: robert | last post by:
I'm using latest numpy & scipy. What is this problem ? : RuntimeError: module compiled against version 1000002 of C-API but this version of numpy is 1000009 Traceback (most recent call last):...
2
by: Chris Smith | last post by:
Howdy, I'm a college student and for one of we are writing programs to numerically compute the parameters of antenna arrays. I decided to use Python to code up my programs. Up to now I haven't...
18
by: robert | last post by:
Is there a ready made function in numpy/scipy to compute the correlation y=mx+o of an X and Y fast: m, m-err, o, o-err, r-coef,r-coef-err ? Or a formula to to compute the 3 error ranges? ...
4
by: HYRY | last post by:
Why the exec time of test(readdata()) and test(randomdata()) of following program is different? my test file 150Hz10dB.wav has 2586024 samples, so I set randomdata function to return a list with...
1
by: 1960_j | last post by:
I have tried to install numpy and scipy on python 5.2. Using gcc 2.95.3, lapack 3.1.1 and ATLAS 3.6.0. When installin numpy it seems to work but when I try to run test get error no test for numpy....
1
by: dingo_1980 | last post by:
I wanted to know if scipy.sparse support or will support the following functions which are available in scipy.linalg or scipy or numpy: Inverse Cholesky SVD multiply power append eig
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.