
Last chance! 50% off unlimited learning
Sale ends in
Estimates the parameter of the Zipf distribution.
zipf(N = NULL, lshape = "loglink", ishape = NULL)
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as
vglm
and vgam
.
Number of elements, an integer satisfying 1 < N < Inf
.
The default is to use the maximum value of the response.
If given, N
must be no less that the largest response value.
If N = Inf
and zetaff
instead).
Parameter link function applied to the (positive) shape parameter Links
for more choices.
Optional initial value for the parameter
T. W. Yee
The probability function for a response
Zipf's law is an experimental law which is often applied
to the study of the frequency of words in a corpus of
natural language utterances. It states that the frequency
of any word is inversely proportional to its rank in the
frequency table. For example, "the"
and "of"
are first two most common words, and Zipf's law states
that "the"
is twice as common as "of"
.
Many other natural phenomena conform to Zipf's law.
pp.526-- of Chapter 11 of Johnson N. L., Kemp, A. W. and Kotz S. (2005). Univariate Discrete Distributions, 3rd edition, Hoboken, New Jersey, USA: Wiley.
dzipf
,
zetaff
,
simulate.vlm
.
zdata <- data.frame(y = 1:5, ofreq = c(63, 14, 5, 1, 2))
zfit <- vglm(y ~ 1, zipf, data = zdata, trace = TRUE, weight = ofreq)
zfit <- vglm(y ~ 1, zipf(lshape = "identitylink", ishape = 3.4), data = zdata,
trace = TRUE, weight = ofreq, crit = "coef")
zfit@misc$N
(shape.hat <- Coef(zfit))
with(zdata, weighted.mean(y, ofreq))
fitted(zfit, matrix = FALSE)
Run the code above in your browser using DataLab