Histogram (automatic binning)

There are different methods for choosing widths of bins for a histogram, like Freedman-Diaconis rule. In Mathematica, without choosing a specific method, with the command Histogram[data], we can produce a histogram for a set of data. My question is: How does Mathematica decide which method is better for a given data?

• In the Details section of the help file, it says: "Histogram[data] by default plots a histogram with equal bin widths chosen to approximate an assumed underlying smooth distribution of the values $x_i$." It does not specify exactly how the smoothing is done though. You can specify the method if you want more control. May 8 at 18:32
• @bills Thanks for your feedback. I'm curious how Mathematica decides on this. For example, sometimes it chooses Scott's rule, and gives this impression that the sample is Gaussian; however, if one specify the method as Freedman-Diaconis, the histogram turns out to be very different. I'd like to know the logic behind Mathematica preference when one doesn't specify any methods.
– user79703
May 8 at 18:38
• Would you give an example where the "histogram is not even calculated according to any named methods in the Documentation" ?
– JimB
May 9 at 1:26
• Nevermind. I see that with a CauchyDistribution[0,1], there is frequently no match.
– JimB
May 9 at 1:51
• For whatever it's worth, I don't think one can figure this out empirically. The choice made seems dependent not only on the shape of the data but also on sample size. Having someone from Wolfram, Inc. confess is maybe the only possibility.
– JimB
May 10 at 15:32