Distribution Fitting
Fit probability distributions and assess normality. Analyzes data distribution with histogram, QQ plot, normality test, and fits multiple probability…
Analyzes data distribution with histogram, QQ plot, normality test, and fits multiple probability distributions (Normal, Lognormal, Exponential, etc.) ranked by AIC/BIC.
What is distribution fitting and why does it matter?
Distribution fitting identifies which probability distribution best describes a dataset. While many assume data is normally distributed, real-world data often follows lognormal (multiplicative processes), exponential (time between events), Weibull (reliability/lifetime), or other distributions. Using the wrong distribution leads to incorrect predictions and process capability estimates.
The fitting process estimates distribution parameters (e.g., mean and σ for Normal, shape and scale for Weibull) using Maximum Likelihood Estimation. Model selection uses information criteria: AIC (Akaike Information Criterion) and BIC (Bayesian Information Criterion) balance fit quality against model complexity. Lower AIC/BIC values indicate a better model.
The Kolmogorov-Smirnov (KS) test compares the empirical cumulative distribution to the fitted theoretical CDF. A high KS p-value (> 0.05) indicates good fit. The QQ-plot provides visual validation: points following the diagonal confirm the chosen distribution is appropriate.
Formula: AIC = 2k - 2ln(L) BIC = k × ln(n) - 2ln(L) KS Statistic = max|Fₙ(x) - F(x)| k = number of parameters L = maximum likelihood n = sample size
Example Calculation
100 measurements fitted to Normal (AIC=312, BIC=317, KS p=0.08) and Lognormal (AIC=305, BIC=310, KS p=0.45). Lognormal has lower AIC/BIC and higher KS p-value — it is the better fit. The QQ-plot for lognormal shows tighter adherence to the diagonal than the normal QQ-plot.
When to Use This Calculator
- Before process capability analysis to determine the correct distribution model — using Cpk formulas on non-normal data gives misleading results
- When analyzing reliability or lifetime data that is typically right-skewed — Weibull, lognormal, or exponential may fit far better than normal
- During process characterization to understand the fundamental shape of your data and select appropriate statistical methods
- When SPC control chart limits seem inappropriate — the data may not be normally distributed, requiring different chart types or transformed data
- When comparing measurement data to supplier specifications — knowing the actual distribution allows accurate prediction of out-of-spec rates
Common Mistakes to Avoid
- Assuming all data is normally distributed without checking — manufacturing data is often skewed (lognormal), bounded (beta), or multimodal (mixture); always fit and compare
- Choosing a distribution based on AIC alone when the KS p-value is very low — AIC ranks relative fit among candidates, but a low KS p-value means even the best candidate may not fit well; collect more data or consider other distributions
- Over-fitting by choosing a complex distribution with many parameters on a small dataset — AIC and BIC penalize complexity, but with small samples, even these criteria can favor overly complex models; prefer simpler distributions when fits are similar
- Not visualizing the fit — numerical criteria alone can be misleading; always check the histogram overlay and QQ-plot to verify the fitted distribution matches the data pattern
How to Interpret Results
- The distribution with the lowest AIC/BIC and highest KS p-value is the best candidate — when AIC and BIC disagree, BIC is more conservative
- KS p-value > 0.05 indicates the fitted distribution is consistent with the data — lower values suggest a poor fit that should not be used for prediction
- If Normal fits well, standard Cpk/Ppk formulas and parametric tests apply directly
- If Lognormal fits best, consider log-transforming data before capability analysis or use non-normal capability methods
- If no standard distribution fits well, the data may be multimodal (mixture of two processes) — investigate whether the data should be stratified
Related Standards & References
- NIST/SEMATECH e-Handbook §1.3.5 — Probability plotting, goodness-of-fit assessment, and distribution selection guidance
- Akaike (1974) & Schwarz (1978) — The original papers defining AIC and BIC, the information criteria used here to rank candidate distributions
- D'Agostino & Stephens, Goodness-of-Fit Techniques (1986) — The classic reference on assessing how well a fitted distribution describes data
- ISO 5479 — Tests for departure from the normal distribution, covering the Shapiro-Wilk normality test reported alongside the fits
Frequently Asked Questions
Which distribution should I try first?
Start with Normal for continuous symmetric data. Try Lognormal for positively skewed data or data that cannot be negative (concentrations, cycle times). Try Weibull or Exponential for lifetime/reliability data. Count data (defects per unit, arrivals) is discrete — this tool fits continuous families only, so model counts with a Poisson or binomial check instead. The histogram shape provides initial guidance: symmetric bell → Normal, right-skewed → Lognormal/Weibull, constant rate → Exponential.
What is the difference between AIC and BIC?
Both penalize model complexity to prevent overfitting, but BIC applies a stronger penalty for additional parameters, especially with large samples. AIC tends to select more complex models (better prediction), while BIC tends to select simpler models (better model identification). When they disagree, BIC is more conservative. Use both — if they agree, confidence in the selection is high.