Freedman–Diaconis rule
From Wikipedia, the free encyclopedia
In statistics, the Freedman–Diaconis rule can be used to select the width of the bins to be used in a histogram.[1] It is named after David A. Freedman and Persi Diaconis.
For a set of empirical measurements sampled from some probability distribution, the Freedman–Diaconis rule is designed approximately minimize the integral of the squared difference between the histogram (i.e., relative frequency density) and the density of the theoretical probability distribution.
In detail, the Integrated Mean Squared Error (IMSE) is
where is the histogram approximation of on the interval computed with data points sampled from the distribution . denotes the expectation across many independent draws of data points. Under mild conditions, namely that and its first two derivatives are , Freedman and Diaconis show that the integral is minimised by choosing the bin width
A formula which was derived earlier by Scott.[2] Swapping the order of the integration and expectation is justified by Fubini's Theorem. The Freedman–Diaconis rule is derived by assuming that is a Normal distribution, making it an example of a normal reference rule. In this case .[3]
Freedman and Diaconis use the interquartile range to estimate the standard deviation: [4] where is the cumulative distribution function for a normal density. This gives the rule
where is the interquartile range of the data and is the number of observations in the sample . In fact if the normal density is used the factor 2 in front comes out to be ,[4] but 2 is the factor recommended by Freedman and Diaconis.