Automatic Distribution Fit Analyzer
Paste a data sample to find its best-fitting distribution: Normal, Log-Normal, Uniform and Exponential are ranked by Anderson-Darling statistic.
Automatic Distribution Fit Analyzer
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: AD = -n - (1/n) * Sum[(2i-1)(ln F(Yi) + ln(1-F(Y(n+1-i))))]
Worked example โ Log-Normal AD = 0.1545 vs Normal AD = 0.1616 โ indistinguishable at n = 20
Formula
AD = -n - (1/n) * Sum[(2i-1)(ln F(Yi) + ln(1-F(Y(n+1-i))))]
The Anderson-Darling statistic measures the distance between the empirical and theoretical cumulative distribution functions. F(Yi) is the CDF of the fitted distribution evaluated at the i-th sorted observation. Lower AD values indicate a better fit. The test is computed for each candidate distribution and the one with the lowest AD statistic is selected as the best fit.
Worked Examples
Example 1: Manufacturing Quality Data โ Normal vs Log-Normal
Problem:Analyze 20 measurements of bolt diameters (mm): 12.3, 14.1, 11.8, 13.5, 12.9, 15.2, 11.2, 14.8, 13.1, 12.6, 13.9, 14.5, 12.1, 13.7, 11.9, 14.3, 13.0, 12.4, 15.0, 13.3
Solution:Mean = 13.2800, StdDev = 1.1478, Skewness = 0.0347, Excess kurtosis = -1.0065 Anderson-Darling: Log-Normal = 0.1545, Normal = 0.1616, Uniform = 0.8640, Exponential = 7.7038 Best fit by the ranking: Log-Normal, with Normal effectively tied Interpretation: near-zero skewness and light tails. On a strictly positive sample this tight, the log transform barely changes the shape, so the 0.007 gap is meaningless โ both sit far below the 0.752 critical value at the 5 percent level, so neither can be rejected. Report Normal here if the process argues for it.
Result:Log-Normal AD = 0.1545 vs Normal AD = 0.1616 โ indistinguishable at n = 20
Example 2: Income Data โ Log-Normal Fit
Problem:Analyze household incomes ($K): 35, 42, 48, 55, 58, 62, 67, 72, 85, 95, 110, 125, 150, 200, 350
Solution:Mean = 103.6000, StdDev = 81.5824, Skewness = 2.2567, Excess kurtosis = 3.6327 Anderson-Darling: Log-Normal = 0.2775, Exponential = 1.3308, Normal = 1.3950, Uniform = 9.7027 Best fit: Log-Normal distribution Interpretation: Strong positive skewness and heavy tails indicate right-skewed data consistent with log-normal. Note that n = 15 is below the 20-observation floor where these comparisons become dependable.
Result:Best Fit: Log-Normal (LogMean = 4.4355, LogStd = 0.6219) | AD = 0.2775
Frequently Asked Questions
What is distribution fitting and why is it important in data analysis?
Distribution fitting is the process of selecting a probability distribution that best describes a given dataset based on statistical criteria. It is fundamentally important because many statistical methods, machine learning algorithms, and engineering reliability models assume the underlying data follows a specific distribution. Correctly identifying the distribution allows analysts to make accurate predictions, calculate probabilities of future events, perform hypothesis tests, construct confidence intervals, and run simulations. For example, quality control in manufacturing relies on knowing whether defect rates follow a Poisson or normal distribution to set proper control limits and predict failure rates accurately.
How does the Anderson-Darling test work for distribution fitting?
The Anderson-Darling (AD) test is a goodness-of-fit test that measures how well a sample dataset follows a specific theoretical distribution. It computes a test statistic by comparing the empirical cumulative distribution function of the data against the theoretical CDF. The AD test gives more weight to the tails of the distribution compared to other tests like Kolmogorov-Smirnov, making it more sensitive to deviations in extreme values. A lower AD statistic indicates a better fit. The formula involves summing weighted differences between observed and expected cumulative probabilities across all sorted data points. Critical values depend on the distribution being tested and the sample size.
What is the difference between normal and log-normal distributions?
A normal distribution is symmetric and bell-shaped, characterized by its mean and standard deviation, with data equally likely to fall above or below the mean. A log-normal distribution describes data whose natural logarithm follows a normal distribution โ the data itself is right-skewed with a long tail extending toward higher values. Log-normal distributions are common in natural and financial phenomena: stock prices, income distributions, particle sizes, and bacterial colony counts often follow log-normal patterns. The key distinguishing feature is that normal data can be negative while log-normal data is always positive. If your data is strictly positive and right-skewed, a log-normal fit often outperforms a normal fit significantly.
What sample size is needed for reliable distribution fitting?
The reliability of distribution fitting increases substantially with sample size. As a general guideline, a minimum of 30 data points is recommended for basic distribution identification, though 50 to 100 observations provide more reliable results. For distinguishing between similar distributions (such as normal versus log-normal when skewness is mild), 100 or more observations may be necessary. With fewer than 20 data points, goodness-of-fit tests have low statistical power and may fail to reject incorrect distributions. The Anderson-Darling test performs reasonably well with samples as small as 8 to 10 observations for detecting major departures from normality, but subtle distributional differences require larger samples for confident identification.
How do skewness and kurtosis help identify the right distribution?
Skewness and kurtosis are key shape statistics that provide initial clues about which distribution family might fit the data. Skewness measures asymmetry: a value near zero suggests symmetry (normal, uniform), positive skewness suggests a right tail (log-normal, exponential, gamma), and negative skewness suggests a left tail (Weibull with certain parameters). Kurtosis measures tail heaviness relative to a normal distribution. Excess kurtosis near zero is consistent with normal data. Positive excess kurtosis indicates heavier tails (t-distribution, Laplace), while negative excess kurtosis indicates lighter tails (uniform, beta). Together they narrow down candidate distributions before formal goodness-of-fit testing. For example, high positive skewness combined with positive excess kurtosis strongly suggests exponential or log-normal.
Why is the lowest Anderson-Darling value not automatically the right distribution?
Ranking by the raw statistic is a screening heuristic rather than a formal test. Every candidate here estimates its parameters from the same sample it is scored against, and families with more freedom to move are flattered by that: the uniform fit takes its endpoints from the sample minimum and maximum, the very observations it is then judged on. Compare the winner against critical values for its own family, and use an information criterion such as AIC or BIC when the candidates differ in parameter count.
What critical values apply when the parameters are estimated from the same data?
Estimating the mean and standard deviation from the sample being tested makes any fit look better than it is, so the statistic is multiplied by the small-sample factor (1 + 0.75/n + 2.25/n squared) and compared against case-specific tables instead of the standard ones. For a normality test with both parameters estimated, the adjusted statistic is commonly judged against roughly 0.752 at the 5 percent level and 1.035 at the 1 percent level. Exceeding a threshold is evidence against that distribution, not proof of any particular alternative.
What does the coefficient of variation tell me before the fitting even runs?
For an exponential distribution the standard deviation equals the mean, so its coefficient of variation is exactly 100 percent. A sample sitting near 8.6 percent, such as the bolt measurements loaded by default, where this page computes a mean of 13.2800 and a standard deviation of 1.1478, is nowhere near exponential whatever the ranking reports, because the exponential's mode sits at zero and that sample's clearly does not. CV works as a fast sanity check: values far below 100 percent point toward normal or a tight log-normal, and values near or above it toward exponential and heavier-tailed families.
How does a Q-Q plot add to what the Anderson-Darling statistic tells me?
The statistic compresses the entire comparison into one number, so it can tell you a fit is poor but never where it fails. A quantile-quantile plot charts the sorted observations against the quantiles the fitted distribution predicts, and points lying on the diagonal mean agreement. Systematic curvature at both ends signals tails heavier or lighter than assumed, a bow shape signals skew the family cannot represent, and a few stray points at one end usually mean outliers rather than the wrong family.
What should I do if none of the four candidate distributions fits well?
These four are a screening set, not a complete library. Right-skewed lifetime and failure data usually wants a Weibull or gamma, proportions bounded between 0 and 1 want a beta, and event counts want Poisson or negative binomial rather than any continuous family. Two patterns defeat single-family fitting outright: bimodal data, which normally means two mixed populations that should be separated first, and data truncated by a measurement floor or ceiling. Those cases belong in R, scipy or comparable software.
References
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer ยท Editorial policy
Related Calculators
๐งฎA B Test Significance Power Analyzer
Calculate a b test significance power analyzer with inputs, formulas, and instant results.
๐งฎSLA Risk Analyzer Uptime Targets
Calculate sla risk analyzer uptime targets with inputs, formulas, and instant results.
๐งฎText Sentiment Analyzer
Calculate text sentiment analyzer with interactive inputs and clear steps.
๐งฎColor Palette Balance AI
Calculate color palette balance ai with inputs, formulas, and instant results.
๐งฎEV Route Charge Planner Range AI
Calculate ev route charge planner range ai with inputs, formulas, and instant results.
๐งฎWork Break Pomodoro Planner AI
Calculate work break pomodoro planner ai with inputs, formulas, and instant results.
๐งฎ3D Print Time Support Estimator
Calculate 3d print time support estimator with inputs, formulas, and instant results.
๐งฎAccessibility Contrast Optimizer WCAG
Calculate accessibility contrast optimizer wcag with inputs, formulas, and instant results.