LogNormalDistribution
Represents the log-normal distribution.
A random variable follows a log-normal distribution when its natural logarithm is normally distributed. Equivalently, if X is normal then exp(X) is log-normal. This makes the log-normal distribution a natural model for multiplicative processes -- situations where many small random factors combine by multiplication rather than addition. Common examples include stock prices, personal incomes, city populations, and body weights.
The distribution is supported on the interval from zero (exclusive) to positive infinity. It is always right-skewed: small values are common while very large values occur rarely but are not negligible. The parameter mu is the mean of the underlying normal distribution (not the mean of the log-normal itself), and sigma is the standard deviation of the underlying normal distribution (not the standard deviation of the log-normal).
Internally, the CDF, survival function, and quantile function delegate to a NormalDistribution applied to the log-transformed input. Random sampling generates a normal variate and exponentiates it.
Example:
val ln = LogNormalDistribution(mu = 0.0, sigma = 1.0)
ln.pdf(1.0) // 0.3989... (density at x = 1)
ln.cdf(1.0) // 0.5 (median of the standard log-normal)
ln.quantile(0.5) // 1.0 (the median equals exp(mu) when sigma > 0)
ln.mean // 1.6487... (exp(0 + 1/2) for mu=0, sigma=1)
ln.sample(Random(42)) // a single random draw from the distribution