I want to get PDF of a set of samples, A, from its histogram:
when I use the following code:
with different number of bins I get different results, to fix it I use this code
but some of numbers in pdf would be greater than one! (the probability should not be greater than one)
I really don't understand where the problem is. I would appreciate if you you could help me. Thank you.
Of course the PDF is different if you have different bin sizes. But most important is how you plan on using the PDF. What do you plan on doing with it? I think n/sum(n) is fine - you just have to know what you're dealing with when it comes time to use it. It tells you the probability of a sample falling into that bin.