Module ndarray_stats::histogram::strategies
source · Expand description
Strategies to build Bins
s and Grid
s (using GridBuilder
) inferring
optimal parameters directly from data.
The docs for each strategy have been taken almost verbatim from NumPy
.
Each strategy specifies how to compute the optimal number of Bins
or
the optimal bin width.
For those strategies that prescribe the optimal number
of Bins
we then compute the optimal bin width with
bin_width = (max - min)/n
All our bins are left-inclusive and right-exclusive: we make sure to add an extra bin
if it is necessary to include the maximum value of the array that has been passed as argument
to the from_array
method.
Structs
Maximum of the
Sturges
and FreedmanDiaconis
strategies.
Provides good all around performance.Robust (resilient to outliers) strategy that takes into
account data variability and data size.
A strategy that does not take variability into account, only data size. Commonly
overestimates number of bins required.
Square root (of data size) strategy, used by Excel and other programs
for its speed and simplicity.
R’s default strategy, only accounts for data size. Only optimal for gaussian data and
underestimates number of bins for large non-gaussian datasets.
Traits
A trait implemented by all strategies to build
Bins
with parameters inferred from observations.