Sturges histogram bin estimator. A very simplistic estimator based on the assumption of normality of the data. This estimator has poor performance for non-normal data, which becomes especially obvious for large data sets. The estimate depends only on size of the data. Para
(x, range)
| 51 | |
| 52 | |
| 53 | def _hist_bin_sturges(x, range): |
| 54 | """ |
| 55 | Sturges histogram bin estimator. |
| 56 | |
| 57 | A very simplistic estimator based on the assumption of normality of |
| 58 | the data. This estimator has poor performance for non-normal data, |
| 59 | which becomes especially obvious for large data sets. The estimate |
| 60 | depends only on size of the data. |
| 61 | |
| 62 | Parameters |
| 63 | ---------- |
| 64 | x : array_like |
| 65 | Input data that is to be histogrammed, trimmed to range. May not |
| 66 | be empty. |
| 67 | |
| 68 | Returns |
| 69 | ------- |
| 70 | h : An estimate of the optimal bin width for the given data. |
| 71 | """ |
| 72 | del range # unused |
| 73 | return _ptp(x) / (np.log2(x.size) + 1.0) |
| 74 | |
| 75 | |
| 76 | def _hist_bin_rice(x, range): |
no test coverage detected
searching dependent graphs…