-1

I've following code-

import scipy.stats as scipystats
print(scipystats.distributions.norm.pdf(1384, 1384, 373))

which prints output of 0.0010695503496 which doesn't make sense to me. What I am trying to do is calculate value of PDF at 1384 given mean of 1384 and std. deviation of 373. I would expect value of PDF at 1384 to be close to 1 as it lies exactly on mean. What am I doing wrong?

user375868
  • 1,288
  • 4
  • 21
  • 45

1 Answers1

1

What you see is normalization.

>>> import scipy.stats as stats
>>> stats.norm.pdf(1384, 1384, 373)
0.0010695503496016962
>>> stats.norm.pdf(0, 0, 373)
0.0010695503496016962
>>> 
>>> 1 / np.sqrt(2.*np.pi) / 373
0.0010695503496016962

With a unit variance:

>>> stats.norm.pdf(0, 0, 1)
0.3989422804014327
>>> stats.norm.pdf(1384, 1384, 1)
0.3989422804014327
>>> 1/np.sqrt(2*np.pi)
0.3989422804014327

See an explicit formula in eg wikipedia

ev-br
  • 24,968
  • 9
  • 65
  • 78
  • can you please further explain what is happening under the hood?I googled unit variance but couldn't find relevant information. – user375868 Apr 12 '15 at 22:01
  • Wikipedia has an explicit formula – ev-br Apr 12 '15 at 22:42
  • actually I am wondering why the value in unit variance is .398 and not 1? intuitively, PDF should be 1 around mean, right? – user375868 Apr 12 '15 at 22:48
  • No. PDF must integrate to one, that's it. There is no restriction of the value of PDF at any particular point. For instance, think of a uniform distribution on (a, b). – ev-br Apr 12 '15 at 23:05