Histogram
Study guide: Exam MAS-I
A Histogram is a plot of a single continuous variable's distribution, in which the range is cut into bins and a bar is drawn over each bin. On the density scale, the area of each bar is the proportion of the n observations in its bin, so the height of the bar over bin j is
\text{height}_j = \frac{n_j}{n\, w_j}
n_jis the number of observations in binj.w_jis the width of binj.
The total area of all the bars is 1, so a density-scale histogram estimates the probability density function. On the count scale, the height of each bar is simply n_j.
A histogram of 500 claim amounts, in thousands, has a first bin from 0 to 2 that holds 180 claims. What is the density-scale height of its bar?
- The bin width is
w_1 = 2.- The height is
\frac{180}{500 \times 2} = 0.18.- The bar's area,
0.18 \times 2 = 0.36, is the proportion of claims in the bin.
Number of observations in a range
On the density scale, the proportion of observations in a range of whole bins is the sum of the bars' areas. The number of observations in the range is
n \sum_{j} \text{height}_j \times w_j
- The sum is over the bins in the range.
A density-scale histogram of 500 claim amounts, in thousands, has bins 0 to 2, 2 to 4, 4 to 8 and 8 to 16, with heights 0.18, 0.14, 0.06 and 0.015. How many claims are at least 2 but less than 8?
- The areas sum to
0.36 + 0.28 + 0.24 + 0.12 = 1, as they must.- The bins from 2 to 8 have areas
0.14 \times 2 = 0.28and0.06 \times 4 = 0.24.- The proportion of claims in the range is
0.28 + 0.24 = 0.52.- The number of claims is
0.52 \times 500 = 260.
Reading the shape of a histogram
A histogram shows a variable's range, its skewness and any second mode. These guide the choice of a model's distribution: a long right tail with no left tail points to a Gamma or lognormal severity, and a spike at zero with a right-skewed remainder points to a Tweedie response. How the variance changes with the mean is read from other plots, such as box plots by group, whose spread grows with the median, or a scatter plot that widens into a wedge.
For a heavily right-skewed positive variable, a histogram of the logarithm spreads out the bulk of the data so that the shape is visible. A distribution that is roughly symmetric on the log scale, as a lognormal is, is strongly right-skewed on the original scale.
A histogram of the logarithm of 2,000 claim amounts is roughly symmetric, with a single hump. What does the histogram of the claim amounts themselves look like?
- A variable whose logarithm is symmetric behaves like a lognormal variable.
- A lognormal distribution is strongly right-skewed.
- The histogram of the claim amounts has a tall bar near zero and a long right tail.
Histogram of a discrete variable
A histogram groups a continuous variable into bins. For a discrete variable, such as a claim count, bins that do not align with the integer values leave empty bins, and the picture depends on where the bin edges fall. A bar chart with one bar per value is the plot for a discrete variable.
Reading bar heights as proportions On the density scale, a bar's height is not the proportion of observations in its bin. Multiply each height by its bin's width, which matters most when the bins have different widths.