I have a discrete random variable with values from $0$ to $100$. I have plotted its histogram with bars centered in $0, 5, 10,\dots,100$. First I made the histogram using the "PDF" option,

PDF histogram

But I notice that the sum of values (height) of, for example, bars $\ge 70$ only sums $0.086$. And therefore, I do not know if the $y$-axis should say probability.

After that, I have used option "Probability".

Probability histogram

In this case, the bars sum to $1$ which indicates that each bar has its value of probability.

I know this can be more a mathematical question than a question about the Mathematica language, but I do not understand the difference between the two options, "PDF" and "Probability". Besides, I do not know how to label the $y$-axis. What label results are more appropriate? Probability? Density? Relative frequency?

Thank you very much for your help.


I believe that when you specify "PDF", the value on the ordinate is the average probability density within a given bin. And to get the "within-this-bin" probability, you need to multiply the ordinate by the bin width (5 in this case); and that's what you get when you specify the "Probability" option.

  • $\begingroup$ Thank you is correct $\endgroup$ – user1993416 Aug 15 '17 at 20:34
  • 3
    $\begingroup$ An additional note that others might find useful for when trying to use the "Count" option in Histogram. To get a continuous PDF to match, scale the density function by (binWidth * Length[data]) $\endgroup$ – mikemtnbikes Oct 20 '17 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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