LogSeries function

Logarithmic series distribution

Logarithmic series distribution

Density, distribution function, quantile function and random generation for the logarithmic series distribution.

dlgser(x, theta, log = FALSE) plgser(q, theta, lower.tail = TRUE, log.p = FALSE) qlgser(p, theta, lower.tail = TRUE, log.p = FALSE) rlgser(n, theta)

Arguments

  • x, q: vector of quantiles.

  • theta: vector; concentration parameter; (0 < theta < 1).

  • log, log.p: logical; if TRUE, probabilities p are given as log(p).

  • lower.tail: logical; if TRUE (default), probabilities are P[Xx]P[X \le x]

    otherwise, P[X>x]P[X > x].

  • p: vector of probabilities.

  • n: number of observations. If length(n) > 1, the length is taken to be the number required.

Details

Probability mass function

f(x)=1log(1θ)θxxf(x)=(1/log(1θ)θx)/x f(x) = \frac{-1}{\log(1-\theta)} \frac{\theta^x}{x}f(x) = (-1/log(1-\theta)*\theta^x) / x

Cumulative distribution function

F(x)=1log(1θ)k=1xθxxF(x)=1/log(1θ)sum((θx)/x) F(x) = \frac{-1}{\log(1-\theta)} \sum_{k=1}^x \frac{\theta^x}{x}F(x) = -1/log(1-\theta) * sum((\theta^x)/x)

Quantile function and random generation are computed using algorithm described in Krishnamoorthy (2006).

Examples

x <- rlgser(1e5, 0.66) xx <- seq(0, 100, by = 1) plot(prop.table(table(x)), type = "h") lines(xx, dlgser(xx, 0.66), col = "red") # Notice: distribution of F(X) is far from uniform: hist(plgser(x, 0.66), 50) xx <- seq(0, 100, by = 0.01) plot(ecdf(x)) lines(xx, plgser(xx, 0.66), col = "red", lwd = 2)

References

Krishnamoorthy, K. (2006). Handbook of Statistical Distributions with Applications. Chapman & Hall/CRC

Forbes, C., Evans, M. Hastings, N., & Peacock, B. (2011). Statistical Distributions. John Wiley & Sons.

  • Maintainer: Tymoteusz Wolodzko
  • License: GPL-2
  • Last published: 2023-11-30