[Numpy-discussion] Normalized histogram for data ranges 0 .. 1 returns PDF > 1
Manos Tsagias
tsagias@gmail....
Tue Feb 2 07:05:42 CST 2010
Hi all,
I'm using numpy.histogram with normed=True with 1D data ranging 0 .. 1. The
results return probabilities greater than 1. The trapezoidal integral
returns 1, but I'm afraid this is due to the bin assigned values. Example
follows:
>>> from numpy import *
>>> a = arange(0, 1, 0.1)
>>> histogram(a, normed=True)
(array([ 1.11111111, 1.11111111, 1.11111111, 1.11111111, 1.11111111,
1.11111111, 1.11111111, 1.11111111, 1.11111111, 1.11111111]),
array([ 0. , 0.09, 0.18, 0.27, 0.36, 0.45, 0.54, 0.63, 0.72,
0.81, 0.9 ]))
Is that normal? If not, does anyone encountered that before? Ideas welcome!
Thanks,
Manos._
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100202/563affa5/attachment-0001.html
More information about the NumPy-Discussion
mailing list