Top Qs
Timeline
Chat
Perspective

Sturges's rule

Statistical rule of thumb From Wikipedia, the free encyclopedia

Remove ads


Sturges's rule[1] is a method to choose the number of bins for a histogram. Given observations, Sturges's rule suggests using

bins in the histogram. This rule is widely employed in data analysis software including Python[2] and R, where it is the default bin selection method.[3]

Sturges's rule comes from the binomial distribution which is used as a discrete approximation to the normal distribution.[4] If the function to be approximated is binomially distributed then

where is the number of trials and is the probability of success and . Choosing gives

In this form we can consider as the normalisation factor and Sturges's rule is saying that the sample should result in a histogram with bin counts given by the binomial coefficients. Since the total sample size is fixed to we must have

using the well-known formula for sums of the binomial coefficients. Solving this by taking logs of both sides gives and finally using (due to counting the 0 outcomes) gives Sturges's rule. In general Sturges's rule does not give an integer answer so the result is rounded up.

Remove ads

Doane's formula

Summarize
Perspective

Doane[5] proposed modifying Sturges's formula to add extra bins when the data is skewed. Using the method of moments estimator

along with its variance

Doane proposed adding extra bins giving Doane's formula

For symmetric distributions this is equivalent to Sturges's rule. For asymmetric distributions a number of additional bins will be used.

Remove ads

Criticisms

Thumb
Histogram of 10,000 samples from a Gamma(2,2) distribution. Number of bins suggested by Scott's rule is 61, Doane's rule 21, and Sturges's rule 15.

Sturges's rule is not based on any sort of optimisation procedure, like the Freedman–Diaconis rule or Scott's rule. It is simply posited based on the approximation of a normal curve by a binomial distribution. Hyndman has pointed out[6] that any multiple of the binomial coefficients would also converge to a normal distribution, so any number of bins could be obtained following the derivation above. Scott[4] shows that Sturges's rule in general produces oversmoothed histograms i.e. too few bins, and advises against its use in favour of other rules such as Freedman-Diaconis or Scott's rule.

Remove ads

References

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads