11.2.1.5. astroML.density_estimation.freedman_bin_width¶
-
astroML.density_estimation.
freedman_bin_width
(data, return_bins=False)[source]¶ Deprecated since version 0.4: The freedman_bin_width function is deprecated and may be removed in a future version. Use astropy.stats.freedman_bin_width instead.
Return the optimal histogram bin width using the Freedman-Diaconis rule
- Parameters
- dataarray-like, ndim=1
observed (one-dimensional) data
- return_binsbool (optional)
if True, then return the bin edges
- Returns
- widthfloat
optimal bin width using Scott’s rule
- binsndarray
bin edges: returned if return_bins is True
Notes
The optimal bin width is
where is the percent quartile of the data, and is the number of data points.