|
From: Diwaker G. <diw...@gm...> - 2006-04-20 17:18:43
|
Hi, Does matplotlib provide functions to plot CDFs and PDFs (ala Matlab)? Thanks, Diwaker -- Web/Blog/Gallery: http://floatingsun.net/blog |
|
From: David H. <dav...@gm...> - 2006-04-20 19:34:29
|
Matplotlib provides hist, an histogram plotting function. For more involved computations, you would have to compute the pdf and cdf first using scipy.stats. For empirical distributions, I think the functions cumfreq and relfreq would do the job. For statistical distributions, use distribution.pdf and distribution.cdf, where distribution is norm, gamma, lognorm, ... David 2006/4/20, Diwaker Gupta <diw...@gm...>: > > Hi, > > Does matplotlib provide functions to plot CDFs and PDFs (ala Matlab)? > > Thanks, > Diwaker > -- > Web/Blog/Gallery: http://floatingsun.net/blog > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmdlnk&kid=120709&bid&3057&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Diwaker G. <diw...@gm...> - 2006-04-22 17:54:56
|
On 4/20/06, David Huard <dav...@gm...> wrote: > Matplotlib provides hist, an histogram plotting function. > For more involved computations, you would have to compute the pdf and cd= f > first using scipy.stats. For empirical distributions, I think the functio= ns > cumfreq and relfreq would do the job. For statistical distributions, use > distribution.pdf and distribution.cdf, where distribution is norm, gamma, > lognorm, ... Thanks for that tip David. Though it seems that even scipy doesn't do exactly what I want. I'm looking to plot the empirical CDF. scipy.stats.cumfreq divides the sample space into "bins" of fixed size, while I want a step function at the given points. I guess I'll just write my own. -- Web/Blog/Gallery: http://floatingsun.net/blog |
|
From: David H. <dav...@gm...> - 2006-04-23 00:28:49
Attachments:
histogramc.py
|
Not too fast !!! I'm currently writing a histogram class to take take of that, among other things. If you want to take a look at it and give me some feedback, it would be great. I haven't tested it extensively so there are certainly some bugs. Basically, call H = Histogram(data) and then H.empirical_cdf(x) will return what you want, the interpolated function. Cheers, David 2006/4/22, Diwaker Gupta <diw...@gm...>: > > On 4/20/06, David Huard <dav...@gm...> wrote: > > Matplotlib provides hist, an histogram plotting function. > > For more involved computations, you would have to compute the pdf and > cdf > > first using scipy.stats. For empirical distributions, I think the > functions > > cumfreq and relfreq would do the job. For statistical distributions, use > > distribution.pdf and distribution.cdf, where distribution is norm, > gamma, > > lognorm, ... > > Thanks for that tip David. Though it seems that even scipy doesn't do > exactly what I want. I'm looking to plot the empirical CDF. > scipy.stats.cumfreq divides the sample space into "bins" of fixed > size, while I want a step function at the given points. > > I guess I'll just write my own. > -- > Web/Blog/Gallery: http://floatingsun.net/blog > |
|
From: Diwaker G. <diw...@gm...> - 2006-04-23 01:29:51
|
On 4/22/06, David Huard <dav...@gm...> wrote: > Not too fast !!! I'm currently writing a histogram class to take take of > that, among other things. If you want to take a look at it and give me so= me > feedback, it would be great. I haven't tested it extensively so there are > certainly some bugs. Basically, call > H =3D Histogram(data) > and then H.empirical_cdf(x) will return what you want, the interpolated > function. Thats amazing, thanks David! I'll test it and get back to you. Right now I just resorted to using Python RPY (interface to r-lang) to get the ecdf. Diwaker -- Web/Blog/Gallery: http://floatingsun.net/blog |
|
From: Alan G I. <ai...@am...> - 2006-04-23 16:33:07
|
On Sat, 22 Apr 2006, David Huard apparently wrote: > I'm currently writing a histogram class to take take of > that, among other things. If you want to take a look at it > and give me some feedback, it would be great. Posting code with a license is helpful. Otherwise it is simply copyrighted these days. Useful licenses include public domain, or BSD, or MIT. Cheers, Alan Isaac |
|
From: David H. <dav...@gm...> - 2006-04-23 19:16:43
|
Thanks for the tip, I intended to submit the class to scipy once sufficiently tested and robust= . I thought that putting no license meant : do what you want with it, and that's what I wanted. Guess I'll have to specify it. What a strange world w= e live in... David 2006/4/23, Alan G Isaac <ai...@am...>: > > On Sat, 22 Apr 2006, David Huard apparently wrote: > > I'm currently writing a histogram class to take take of > > that, among other things. If you want to take a look at it > > and give me some feedback, it would be great. > > Posting code with a license is helpful. > Otherwise it is simply copyrighted these days. > Useful licenses include public domain, or BSD, or MIT. > > Cheers, > Alan Isaac > > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Robert K. <rob...@gm...> - 2006-04-23 20:01:37
|
David Huard wrote: > Thanks for the tip, > I intended to submit the class to scipy once sufficiently tested and > robust. Excellent! Thank you. > I thought that putting no license meant : do what you want with > it, and that's what I wanted. Guess I'll have to specify it. What a > strange world we live in... No, since sometime in the '70s, at least in the US, all original copyrightable works are automatically copyrighted at their creation. If you want people to be able to copy, modify, spindle, mutilate it, you have to give them permission. The easiest thing to do for code is usually to just say that it's license is the MIT or maybe BSD license (which we would prefer for scipy). And don't get me started on the public domain. -- Robert Kern rob...@gm... "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 |