Know these first
- M-C01: Probability basics
Math Atoms
By the end you will be able to
- 1Build a histogram: choose bins and count the values in each.
- 2Tell frequency from density, and convert between them.
- 3Explain how the bin width changes the picture.
- 4Read the share of values at or below any level from the empirical distribution.
Why you need it
A list of 250 numbers tells you very little at a glance. Sort them into bins and draw the counts, and the shape jumps out: where the middle is, how wide it spreads, and how far the extremes reach.
These Core Path lessons use it:
Histograms show the shape of past returns: the centre, the spread and the tails.
It reads the share of past outcomes below a level straight from the empirical distribution.
The idea
Sort into bins, then count
Cut the number line into equal pieces, called bins. Take each value in turn and drop it into the bin it belongs to. The piles you end up with are a histogram.
Sort values into bins
0 of 20 dropped · bins 1% wide0.4−1.30.92.1−0.20.6−0.81.40.1−2.40.7−0.51.10.3−1.70.2−0.11.8−0.60.5
Press the button to drop the first value.
Most values pile up near 0, and a few sit out at the edges. That outline, tall in the middle and thin at the ends, is the shape of the data.
The rules
Bins and counts. A histogram needs one choice from you, the bin width, and one convention for values on an edge.
Frequency or density? The bar height can be the count (the frequency), the share, or the density. Density is the one to use when you compare histograms with different bin widths or sample sizes, or lay a curve such as the normal from M-C06: The normal distribution on top.
The empirical distribution. A histogram answers “how many in this bin?”. The question “what share is below this level?” is answered directly, without bins, by the empirical distribution function.
Read the empirical distribution
the same 20 valuesThe rules, for reference
The # sign means “the number of”. Reading backwards, from a share to a value, gives a quantile: see M-C09: Quantiles.
Try it
Slide the bin width from very narrow to very wide: when does the shape look clearest? Switch to density and change the number of days: the bars stay on the same scale. Then move x into the left tail and read the share of days at or below it.
Try itHistogram explorer
Descriptive statistics calculator →Bar height
Number of days
Worked examples
1. A histogram by hand
Step 1 of 3- 1
The set-up
Twelve daily returns, in % (illustrative): −1.6, −0.4, 0.3, 1.2, −0.7, 0.1, 2.3, −0.2, 0.8, −1.1, 0.5, 0.6. Use bins 1% wide, starting at a whole number.
2. Same data, different bins
Step 1 of 3- 1
Half-width bins (h = 0.5)
Bin Count Density = count ÷ (12 × 0.5) −2% to −1.5% 1 0.167 −1.5% to −1% 1 0.167 −1% to −0.5% 1 0.167 −0.5% to 0% 2 0.333 0% to 0.5% 2 0.333 0.5% to 1% 3 0.5 1% to 1.5% 1 0.167 1.5% to 2% 0 0 2% to 2.5% 1 0.167
3. What share of days was below −2%?
Step 1 of 4- 1
The set-up
Take the first 250 illustrative daily returns from the Try it. What share of days had a return of −2% or worse?
Common mistakes
Each line below is a tempting slip. Spot what is wrong, then check.
Reaction
Check what stuck
Question 1 · objective 2
40 of 200 values fall in a bin 0.5 wide. What is the density height of that bar?
Question 2 · objective 3
In count mode, you double the bin width. What usually happens?
Question 3 · objective 4
Of 250 daily returns, 12 are at or below −2%. What is the empirical share F̂(−2%), in %?
Question 4 · objective 2
What do the bars of a density histogram add up to?
Question 5 · objective 4
Data: 3, 7, 1, 9, 4. What share of the values is at or below 4? (Answer as a decimal.)
Glossary
- Histogram
- A bar chart of data grouped into bins: each bar shows how many values (or what share) fall in its bin.
- Bin
- One interval of the axis, such as from 0% up to 1%. Here a value on an edge goes in the bin to its right.
- Bin width
- The length of each bin, h. Narrow bins show more detail and more noise; wide bins smooth both away.
- Frequency and relative frequency
- The count of values in a bin, n_k. Its share of all the data, n_k / n, is the relative frequency.
- Density
- Bar height n_k / (n h), chosen so that each bar's area is its share of the data and all the areas add up to 1.
- Empirical distribution function
- F̂(x): the share of the data at or below x. A staircase that climbs by 1/n at each value.