dist_logarithmic: The Logarithmic distribution

View source: R/dist_logarithmic.R

dist_logarithmicR Documentation

The Logarithmic distribution

Description

[Stable]

The Logarithmic distribution is a discrete probability distribution derived from the logarithmic series. It is useful in modeling the abundance of species and other phenomena where the frequency of an event follows a logarithmic pattern.

Usage

dist_logarithmic(prob)

Arguments

prob

parameter. 0 <= prob < 1.

Details

We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_logarithmic.html

In the following, let X be a Logarithmic random variable with parameter prob = p.

Support: \{1, 2, 3, ...\}

Mean: \frac{-1}{\log(1-p)} \cdot \frac{p}{1-p}

Variance: \frac{-(p^2 + p\log(1-p))}{[(1-p)\log(1-p)]^2}

Probability mass function (p.m.f):

P(X = k) = \frac{-1}{\log(1-p)} \cdot \frac{p^k}{k}

for k = 1, 2, 3, \ldots

Cumulative distribution function (c.d.f):

The c.d.f. does not have a simple closed form. It is computed using the recurrence relationship P(X = k+1) = \frac{p \cdot k}{k+1} \cdot P(X = k) starting from P(X = 1) = \frac{-p}{\log(1-p)}.

Moment generating function (m.g.f):

E(e^{tX}) = \frac{\log(1 - pe^t)}{\log(1-p)}

for pe^t < 1

See Also

actuar::Logarithmic

Examples

dist <- dist_logarithmic(prob = c(0.33, 0.66, 0.99))
dist


mean(dist)
variance(dist)
support(dist)
generate(dist, 10)

density(dist, 2)
density(dist, 2, log = TRUE)

cdf(dist, 4)

quantile(dist, 0.7)


distributional documentation built on June 27, 2026, 5:06 p.m.