[SciPy-user] CDF/PDF Stats with SciPy
Mon Jul 20 15:11:29 CDT 2009
Thanks for your reply. But I am getting a little confused here now. It seems
there are multiple ways to get the CDF for a distribution. You mean linspace
function returns a CDF for a normal distribution.
As far as I understood from other sources is that scipy.stats.norm.cdf
(mean, std) will return the CDF for the normal distribution or for
non-normal distribution given one replace *norm* with the distributions
And what about scipy.stats.<dist>.fit function?
> Message: 7
> Date: Mon, 20 Jul 2009 12:07:10 -0400
> From: Ivo Maljevic <email@example.com>
> Subject: Re: [SciPy-user] CDF/PDF Stats with SciPy
> To: SciPy Users List <firstname.lastname@example.org>
> Content-Type: text/plain; charset="iso-8859-1"
> Hi Omer,
> For histogram you can either use histogram function from numpy/scipy:
> from scipy import *
> x = .... # some vector
> h,bins = histogram(x,50,normed=True,new=True) # find the histogram, number
> of bins = 50
> or you can use pylab's version (good for plotting):
> import matplotlib.pyplot as plt
> count, bins, ignored = plt.hist(x, 50, normed=True)
> For CDF you can use cumsum function (standard approach), but for smaller
> number of data points I
> prefer to use all the points, which is a neat trick:
> from scipy import *
> def my_cdf(x):
> bins = sort(x)
> cdf = linspace(0,1,len(bins))
> return [bins, cdf]
> 2009/7/20 Omer Khalid <Omer.Khalid@cern.ch>
> > Hi Everybody,
> > I am new to Python and new to SciPy libraries. I wanted to take some ques
> > from the experts here on the list before dive into SciPy world.
> > I was wondering if some one could provide a rough guide about how to run
> > two stats functions: Cumulative Distribution Function (CDF) and
> > Distribution Function (PDF).
> > My use case is the following: I have a sampleSpaceList  which have 1000
> > floating point values. When a new floating point value is generated in my
> > program, I would like to run both CDF and PDF on the sampleList for it
> > get the probabilty of value less or equal for CDF and probablity
> > distribution for PDF.
> > Many thanks in advance!
> > Omer
> > _______________________________________________
> > SciPy-user mailing list
> > SciPyemail@example.com
> > http://mail.scipy.org/mailman/listinfo/scipy-user
> -------------- next part --------------
> An HTML attachment was scrubbed...
> SciPy-user mailing list
> End of SciPy-user Digest, Vol 71, Issue 32
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User