Understanding the lognormal distribution calculator — concept and principle
This calculator gives probabilities and summary statistics for a lognormal distribution, where ln X is normal with mean μ and standard deviation σ. It returns P(X ≤ x), P(X > x), the density, the mean, median, mode, variance, standard deviation and the z-score of ln x. Use it for incomes, particle sizes, repair times, stock prices and other positive, right-skewed quantities.
How it is calculated
P(X ≤ x) = Φ((ln x − μ) ÷ σ)
Density f(x) = exp(−(ln x − μ)² ÷ (2σ²)) ÷ (xσ√(2π)), for x > 0
Median = e^μ; mean = e^(μ + σ²/2); mode = e^(μ − σ²)
Variance = (e^(σ²) − 1)·e^(2μ + σ²)
- μ and σ describe ln X, not X itself.
The principle
When a quantity grows by many small random percentage changes, its logarithm is a sum of many small random terms, which tends toward a normal distribution. So the quantity itself is lognormal: never negative, with a long right tail. The skew shows in the summary statistics: the mode is below the median, which is below the mean. The median, e^μ, is often the most useful single number.
Worked example
Default inputs: μ = 3, σ = 0.5, x = 25.
- z = (ln 25 − 3) ÷ 0.5 = (3.2189 − 3) ÷ 0.5 = 0.4378.
- P(X ≤ 25) = Φ(0.4378) = 0.669217; P(X > 25) = 0.330783.
- Density f(25) = 0.0289994.
- Median = e³ = 20.0855; mean = e^3.125 = 22.7599; mode = e^2.75 = 15.6426.
- Variance = 147.129; standard deviation = 12.1297.
| μ (mean of ln X) | P(X ≤ x) |
|---|---|
| 0.75 | 1 |
| 1.5 | 0.999707 |
| 2.25 | 0.973673 |
| 3 | 0.669217 |
| 3.75 | 0.144061 |
| 4.5 | 0.00519985 |
| 6 | 1.3316e-8 |
How to read the result
About two thirds of values are 25 or less. The mean (22.8) is pulled above the median (20.1) by the long right tail, a typical sign of skewed data such as incomes. If you only know the mean and standard deviation of X, you must first convert them to μ and σ of ln X.
Common mistakes
- Entering the mean of X as μ instead of the mean of ln X.
- Using a normal distribution for strongly skewed positive data.
- Expecting the mean and median to be equal.
- Taking the logarithm in base 10 instead of the natural log.
Frequently asked questions
What is a lognormal distribution?
The distribution of X when ln X is normally distributed.
What is the median of a lognormal distribution?
e^μ.
Why is the mean larger than the median?
The long right tail pulls the mean up.
Sources: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.9 Lognormal Distribution