 # normed histograms

I see that passing normed=True to the hist function is supposed scale the
histogram counts to represent a probability distribution. Presently, this
renormalizes the counts such that the most popular bin is 1, but I would
argue that this does not represent a probability distribution. I think it
would be more appropriate to renormalize such that integrating over the whole
distribution yields 1.

Maybe there are other schools of thought on this subject? Is there a way that
I can generate a physicists probability distribution with the existing
function?

Thanks,
Darren

Darren Dale wrote:

I see that passing normed=True to the hist function is supposed scale the histogram counts to represent a probability distribution. Presently, this renormalizes the counts such that the most popular bin is 1, but I would argue that this does not represent a probability distribution. I think it would be more appropriate to renormalize such that integrating over the whole distribution yields 1.

Are you sure? With CVS matplotlib:

In :hist(y)
Out:
(array([ 17, 44, 130, 244, 260, 176, 91, 29, 8, 1]),
array([-2.85420394, -2.18336129, -1.51251864, -0.841676 , -0.17083335, 0.5000093 ,
1.17085195, 1.84169459, 2.51253724, 3.18337989]))

In :hist(y, normed=True)
Out:
(array([ 0.02534126, 0.06558915, 0.19378613, 0.36372166, 0.38757226, 0.26235661,
0.13565029, 0.04322921, 0.0119253 , 0.00149066]),
array([-2.85420394, -2.18336129, -1.51251864, -0.841676 , -0.17083335, 0.5000093 ,
1.17085195, 1.84169459, 2.51253724, 3.18337989]))

···

--
Robert Kern
rkern@...376...

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

It turned out that I had a funny set of data that just happened to have a max
normed count of 1, but the distribution still summed to 1. The normed
operation is working the way it should.

···

On Friday 06 May 2005 5:58 pm, Robert Kern wrote:

Darren Dale wrote:
> I see that passing normed=True to the hist function is supposed scale the
> histogram counts to represent a probability distribution. Presently, this
> renormalizes the counts such that the most popular bin is 1, but I would
> argue that this does not represent a probability distribution. I think it
> would be more appropriate to renormalize such that integrating over the
> whole distribution yields 1.

Are you sure? With CVS matplotlib:

In :hist(y)
Out:
(array([ 17, 44, 130, 244, 260, 176, 91, 29, 8, 1]),
array([-2.85420394, -2.18336129, -1.51251864, -0.841676 ,
-0.17083335, 0.5000093 ,
1.17085195, 1.84169459, 2.51253724, 3.18337989]))

In :hist(y, normed=True)
Out:
(array([ 0.02534126, 0.06558915, 0.19378613, 0.36372166, 0.38757226,
0.26235661,
0.13565029, 0.04322921, 0.0119253 , 0.00149066]),
array([-2.85420394, -2.18336129, -1.51251864, -0.841676 ,
-0.17083335, 0.5000093 ,
1.17085195, 1.84169459, 2.51253724, 3.18337989]))

--
Darren S. Dale

Bard Hall
Department of Materials Science and Engineering
Cornell University
Ithaca, NY. 14850

dd55@...163...