# Why use a probability distribution function instead of a histogram?

Is a probability distribution function (displayed with bins) effectively a histogram that has been normalized so that the bins sum to 1?

Say in the case of a dataset of 10,000 particles (each with a temperature, pressure and density value) with which you wish to display a distribution of pressures for a given temperature interval. What would be the advantage of displaying bins with pressure on the horizontal axis and probability on the vertical axis as opposed to counts in the form of a histogram?

• In terms of your first paragraph: If you're seeking a definition of probability distribution function it has to cover the case of continuous variables. That can be done (certain awkward exceptions and pathologies aside) in terms of imagining bins that become arbitrarily small. But a probability distribution function isn't fundamentally defined in terms of whatever display is convenient to show it. I don't really understand your second paragraph: whether a histogram for a finite data sample shows counts or probabilities is at choice, the likely readership being possibly the deciding factor. – Nick Cox Nov 27 '17 at 14:54

## 2 Answers

I think your question really boils down to the display option of the histogram, where you can put either counts (frequencies) or probabilities on y-axis. Both options have uses, neither is better than the other.

For instance, when performing chi-squared test you need frequencies (counts) to plug into the formula: $$\sum_i \frac{(O_i-E_i)^2}{E_i}$$ where $$O_i$$, $$E_i$$ are observed and expected event counts.

On the other hand, having probabilities on y-axis is useful to understand the probability distribution of the phenomenon. For instance, the expected count $$E_i$$ is most likely obtained by scaling the total number of events $$n$$: $$E_i-n\times p_i$$ where $$p_i$$ is the probability of a bin $$i$$. The probability distribution $$f(i)=p_i$$ is the invariant here, it stays the same regardless of the number of total events. Individual counts of bins increases as you gather more data.

The biggest advantage of a normalized histogram is that it will converge (in most cases) to the true underlying distribution as you collect more data, while the counts will all blow up to infinity.

However, in small datasets, it may be good to show the raw counts so people know how many data points actually fell in each bin...histograms (normalized or not) can be very noisy for small datasets or datasets with high variance.