Histogram

Statistics & Probability

A histogram is a bar graph that displays the distribution of numerical data by grouping values into intervals called bins.

Definition

A histogram is a special bar chart that shows how often values fall into different ranges. The bars touch each other because the ranges are connected with no gaps.

Example

A histogram of student heights groups them: $50$-$54$ in ($3$ students), $55$-$59$ in ($7$ students), $60$-$64$ in ($10$ students), $65$-$69$ in ($5$ students). The tallest bar is in the $60$-$64$ range.

Key Insight

Unlike a regular bar graph for categories, a histogram shows numbers grouped into ranges. The shape of the histogram reveals whether data clusters in the middle, at one end, or is spread evenly.

Definition

A histogram displays the distribution of continuous or grouped numerical data. Equal-width intervals (bins) are marked on the horizontal axis; bar height (or area) represents frequency or relative frequency. Bars are adjacent (no gaps), reflecting the continuous nature of the data.

Example

Exam scores for $50$ students, binned in intervals of $10$ ($50$-$59$, $60$-$69$, etc.). If the $80$-$89$ bin is tallest, most students scored in that range. The shape may reveal a normal distribution or a skew.

Key Insight

The shape of a histogram reveals distribution features: symmetric (bell-shaped), left-skewed (long left tail), right-skewed (long right tail), bimodal (two peaks), or uniform.

Definition

A histogram with bins of equal width $h$ estimates the probability density as $\hat{f}(x) = n_i/(nh)$ for $x$ in bin $i$, where $n_i$ is the bin count and $n$ is total sample size. Optimal bandwidth $h^*$ minimizes the asymptotic mean integrated squared error (AMISE): $h^* = \left(\dfrac{24\sqrt{\pi}}{n \int f''(x)^2\,dx}\right)^{1/5}$.

Example

For a standard normal distribution, the AMISE-optimal bin width for $n = 100$ is approximately $0.53$, giving about $(\text{max}-\text{min})/0.53$ bins. Freedman-Diaconis rule $h = 2 \cdot \text{IQR} \cdot n^{-1/3}$ is a robust alternative.

Key Insight

Kernel density estimation (KDE) can be seen as a smoothed histogram, replacing each bin by a smooth kernel function centered at each data point, addressing the sensitivity of histograms to bin placement.