bundles / numpy 2.4.3 / numpy / lib / _histograms_impl / _hist_bin_stone
function
numpy.lib._histograms_impl:_hist_bin_stone
Signature
def _hist_bin_stone ( x , range ) Summary
Histogram bin estimator based on minimizing the estimated integrated squared error (ISE).
Extended Summary
The number of bins is chosen by minimizing the estimated ISE against the unknown true distribution. The ISE is estimated using cross-validation and can be regarded as a generalization of Scott's rule. https://en.wikipedia.org/wiki/Histogram#Scott.27s_normal_reference_rule
This paper by Stone appears to be the origination of this rule. https://digitalassets.lib.berkeley.edu/sdtr/ucb/text/34.pdf
Parameters
x: array_likeInput data that is to be histogrammed, trimmed to range. May not be empty.
range: (float, float)The lower and upper range of the bins.
Returns
h: An estimate of the optimal bin width for the given data.
Aliases
-
numpy.lib._histograms_impl._hist_bin_stone