EasyDeepLearn

How do you choose bin width for a histogram?

medium

Answer

  • Rules of thumb: Sturges' (log2(n)+1, small n), Scott's (3.5σ  /  n(1/3),  assumes  nearnormal)(3.5{\sigma}\; / \;n(1 / 3), \;\mathrm{assumes}\;\mathrm{near} - \mathrm{normal}), Freedman-Diaconis (2IQR  /  n(1/3),  robust  to  skew)(2 \cdot \mathrm{IQR}\; / \;n(1 / 3), \;\mathrm{robust}\;\mathrm{to}\;\mathrm{skew}).
  • Modern default in most libraries: Freedman-Diaconis.
  • Too few bins hide structure; too many create noisy jaggedness.
  • Best practice: try 2-3 bin widths, or use KDE (kernel density estimate) for a smooth alternative.
Check yourself — multiple choice
  • One bin
  • Freedman-Diaconis (2IQR/n(1/3))(2 \cdot \mathrm{IQR} / n(1 / 3)) is robust default; too few bins hide structure, too many are noisy; KDE is smooth alternative
  • Always 10 bins
  • Bin width is irrelevant

Bin width: F-D robust default; try 2-3 or KDE for smooth.

#descriptive#eda

Practise Statistics Fundamentals

215 interview questions in this topic.

Related questions