LogarithmicDistribution
Represents the logarithmic (log-series) distribution, a discrete power-series distribution on the positive integers {1, 2, 3, ...}.
The probability of observing k is proportional to p^k / k. This distribution arises as the conditional distribution of the number of occurrences given at least one occurrence, and commonly models species abundance in ecology (Fisher's logarithmic series), word frequency distributions, and cascade failures in networks.
The PMF is f(k) = -p^k / (k * ln(1 - p)) for k = 1, 2, 3, ...
The normalization constant is -1 / ln(1 - p), derived from the Maclaurin series -ln(1 - p) = Σ_{k=1}^{∞} p^k / k.
Example:
val dist = LogarithmicDistribution(probability = 0.5)
dist.pmf(1) // 0.7213 (most probable value)
dist.pmf(3) // 0.0601
dist.cdf(2) // 0.9017
dist.mean // 1.4427
dist.quantileInt(0.5) // 1 (median)
dist.sample(Random(42)) // a single random drawContent copied to clipboard