Distribution Fitting
Overview
Distribution fitting overlays a parametric probability density on the histogram, estimated from the same sample by maximum likelihood. It turns the qualitative impression of a histogram ("roughly bell-shaped", "skewed right") into a quantitative statement: which named family describes the data best, with which parameters — useful for reporting, for spotting log-normally distributed quantities (common for strictly positive engineering responses), and as groundwork for reliability statements.
Three families are supported: Normal, Log-normal, and Weibull. The latter two apply only to strictly positive samples.
Formula
For a sample the maximum-likelihood estimates are:
Normal — closed form:
Log-normal — the Normal MLE applied to (parameters ).
Weibull with shape and scale , density — no closed form; the shape solves the MLE equation
found by bisection (the left side is monotone in ), after which . The equation is scale-invariant, so Tunny Dashboard normalizes by first to avoid overflow of at large .
Model comparison uses the Akaike information criterion. All three families have two parameters, so
and ranking by AIC is equivalent to ranking by likelihood here; AIC is reported for continuity with mixed-parameter-count comparisons.
To overlay the density on a count histogram, the PDF is scaled by (sample size × bin width), so the curve and the bars share the same vertical axis.
Characteristics
- MLE is not a goodness-of-fit test. The best AIC among the three families is only "the least bad of these three" — a sample from a bimodal or heavy-tailed distribution still gets a winner. Judge the overlay visually against the bars before quoting parameters.
- The Log-normal and Weibull fits silently become unavailable when the sample contains zero or negative values; only the Normal fit remains.
- The Weibull shape parameter is interpretable: indicates a decreasing hazard (infant-mortality-like), reduces to the exponential distribution, an increasing hazard — the reason Weibull dominates reliability engineering.
- MLE variance estimates are biased low by the factor relative to the unbiased sample variance; at the sample sizes where fitting is meaningful this is negligible.
Where It Is Used in the App
- Histogram widget → Fit selector: overlays the selected family (or the best-AIC family with Auto) on the histogram, and prints the fitted parameters and AIC for each applicable family.
References
- Akaike, H. (1974). A new look at the statistical model identification. IEEE Transactions on Automatic Control, 19(6), 716–723. https://doi.org/10.1109/TAC.1974.1100705