Learn R Programming

tolerance (version 0.4.0)

zm.ll: Maximum Likelihood Estimation for Zipf-Mandelbrot Models

Description

Performs maximum likelihood estimation for the parameters of the Zipf, Zipf-Mandelbrot, and zeta distributions.

Usage

zm.ll(x, N = NULL, s = 1, b = 1, dist = c("Zipf", "Zipf-Man", 
      "Zeta"), exact = TRUE, ...)

Arguments

x
A vector or table of counts which is distributed according to a Zipf, Zipf-Mandelbrot, or zeta distribution.
N
The number of categories when dist = "Zipf" or dist = "Zipf-Man". This is not used when dist = "Zeta". If N = NULL, then N is estimated based on the number of categories observed in the da
s
The initial value to estimate the shape parameter, which is set to 1 by default. If a poor initial value is specified, then a WARNING message is returned.
b
The initial value to estimate the second shape parameter when dist = "Zipf-Man", which is set to 1 by default. If a poor initial value is specified, then a WARNING message is returned.
dist
Options are dist = "Zipf", dist = "Zipf-Man", or dist = "Zeta" if the data is distributed according to the Zipf, Zipf-Mandelbrot, or zeta distribution, respectively.
exact
If exact = TRUE, then an ordinal ranking (based on the category labels) of the data is used. If exact = FALSE, then a Zipfian ranking of the data will be used (i.e., the data will be arranged by the raw counts in decreasing orde
...
Additional arguments passed to the mle function.

Value

  • See the help file for mle to see how the output is structured.

Details

Zipf-Mandelbrot models are commonly used to model phenomena where the frequencies of categorical data are approximately inversely proportional to its rank in the frequency table.

References

Mandelbrot, B. B. (1965), Information Theory and Psycholinguistics. In B. B. Wolman and E. Nagel, editors. Scientific Psychology, Basic Books.\ Zipf, G. K. (1949), Human Behavior and the Principle of Least Effort, Hafner.\ Z"{o}rnig, P. and Altmann, G. (1995), Unified Representation of Zipf Distributions, Computational Statistics and Data Analysis, 19, 461--473.

See Also

mle, Zeta, Zipf, ZipfMandelbrot, zm.ll

Examples

Run this code
## Maximum likelihood estimation for randomly generated data
## from the Zipf, Zipf-Mandelbrot, and zeta distributions. 

set.seed(100)

s <- 2
b <- 5
N <- 50

zipf.data <- rzipf(n = 500, s = s, N = N)
out.zipf <- zm.ll(zipf.data, N = N, dist = "Zipf")
coef(out.zipf)
vcov(out.zipf)

zipfman.data <- rzipfman(n = 500, s = s, b = b, N = N)
out.zipfman <- zm.ll(zipfman.data, N = N, dist = "Zipf-Man")
coef(out.zipfman)
vcov(out.zipf)

zeta.data <- rzeta(n = 200, s = s)
out.zeta <- zm.ll(zeta.data, dist = "Zeta")
coef(out.zeta)
vcov(out.zeta)

Run the code above in your browser using DataLab