0
$\begingroup$

I am working on a personal project and want to understand what the output of Scipy's pdf() function. I understand that the PDF is for one singular line under a distribution curve so finding a point under that function would be zero. But when working with scipy, i get a number im not quite understanding.

from scipy.stats import norm

norm.pdf(0)
#0.3989422804014327

norm.pdf(0, loc=5, scale=10)
#0.03520653267642995

r = np.random.randn(10)

norm.pdf(r)
#array([0.39739838, 0.31770265, 0.06576943, 0.252755  , 0.38386191,
       #0.31203894, 0.34385005, 0.39185893, 0.39848757, 0.38723303])
$\endgroup$

1 Answer 1

2
$\begingroup$

Putting it simply, pdf() returns the y value upon the distribution curve (gaussian if you use a normal distribution) given the x and other parameters you supply. Probability for a given interval is defined as the respective area under curve.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.