After thinking it over, I did not go for
Robert or David's cool numpy tricks, but
I'll append a simple object in case someone
else wants to do more.
Cheers,
Alan Isaac
class EmpiricalCDF(object):
'''Empirical cdf.
First point will be (xmin,0).
Last point will be (xmax,1).
'''
On Thu, 27 Sep 2007, David Huard apparently wrote:
> scipy/sandbox/dhuard/stats.py
Well, I also did not think of a double application of
argsort to rank the observations. Nice. OK, I've got plenty
to work with now.
Thanks,
Alan
--
On Wed, 26 Sep 2007, Robert Kern apparently wrote:
> n = len(x)
> x2 = np.repeat(x, 2)
> y2 = np.hstack([0.0, np.repeat(np.arange(1,n) / float(n), 2), 1.0])
> pylab.plot(x2, y2)
OK, that's pretty slick.
I did not think about ``repeat``.
Thanks,
Alan
Hi Alan,
There is an empiricalcdf function in scipy/sandbox/dhuard/stats.py
It's not fancy but it might do what you want.
David
2007/9/26, Alan Isaac <[EMAIL PROTECTED]>:
>
> Is there a standard function or practice for
> plotting the CDF of a series? (I am aware
> of the output of hist.)
>
> T
Alan Isaac wrote:
> Is there a standard function or practice for
> plotting the CDF of a series? (I am aware
> of the output of hist.)
import numpy as np
from matplotlib import pylab
x = ... # whatever
n = len(x)
x2 = np.repeat(x, 2)
y2 = np.hstack([0.0, np.repeat(np.arange(1,n) / float(n), 2),
On Sep 26, 2007, at 5:09 PM, Alan Isaac wrote:
> Is there a standard function or practice for
> plotting the CDF of a series? (I am aware
> of the output of hist.)
Without really knowing what CDF is (I am assuming
it is Cumulative Density Fucntion or something similar).
I would suggest taking a
Is there a standard function or practice for
plotting the CDF of a series? (I am aware
of the output of hist.)
Thank you,
Alan Isaac
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual