|
10 | 10 |
|
11 | 11 | A couple of other options to the ``hist`` function are demonstrated.
|
12 | 12 | Namely, we use the ``normed`` parameter to normalize the histogram and
|
13 |
| -a couple of different options to the ``cumulative`` parameter. Normalizing |
14 |
| -a histogram means that the bin heights are scaled such that |
15 |
| -the total area is 1. Since we're showing a normalized and |
16 |
| -cumulative histogram, the max value at the end of the series is 1. |
17 |
| -The ``normed`` parameter takes a boolean value. |
18 |
| -
|
19 |
| -The ``cumulative`` kwarg is a little more nuanced. Like ``normed``, you |
20 |
| -can pass it True or False, but you can also pass it -1 and that will |
21 |
| -reverse the distribution. In engineering, CDFs where ``cumulative`` is |
22 |
| -simply True are sometimes "non-exceedance" curves. In other words, you |
23 |
| -can look at the y-value to set the probability of exceedance. For |
24 |
| -example the value of 225 on the x-axis corresponds to about 0.85 on the |
25 |
| -y-axis, so there's an 85% chance that an observation in the sample does |
26 |
| -not exceed 225. |
27 |
| -
|
28 |
| -Conversely, setting, ``cumulative`` to -1 as is done in the last series |
29 |
| -for this example, creates a "exceedance" curve. |
| 13 | +a couple of different options to the ``cumulative`` parameter. |
| 14 | +The ``normed`` parameter takes a boolean value. When ``True``, the bin |
| 15 | +heights are scaled such that the total area of the histogram is 1. The |
| 16 | +``cumulative`` kwarg is a little more nuanced. Like ``normed``, you |
| 17 | +can pass it True or False, but you can also pass it -1 to reverse the |
| 18 | +distribution. |
| 19 | +
|
| 20 | +Since we're showing a normalized and cumulative histogram, these curves |
| 21 | +are effectively the cumulative distribution functions (CDFs) of the |
| 22 | +samples. In engineering, empirical CDFs where are sometimes called |
| 23 | +"non-exceedance" curves. In other words, you can look at the |
| 24 | +y-value for a given-x-value to get the probability of and observation |
| 25 | +from the sample not exceeding that x-value. For example, the value of |
| 26 | +225 on the x-axis corresponds to about 0.85 on the y-axis, so there's an |
| 27 | +85% chance that an observation in the sample does not exceed 225. |
| 28 | +Conversely, setting, ``cumulative`` to -1 as is done in the |
| 29 | +last series for this example, creates a "exceedance" curve. |
30 | 30 |
|
31 | 31 | Selecting different bin counts and sizes can significantly affect the
|
32 | 32 | shape of a histogram. The Astropy docs have a great section on how to
|
|
0 commit comments