Differenced Zeta Distribution Family Function
diffzeta.RdEstimates the parameter of the differenced zeta distribution.
Arguments
- lshape, ishape
Same as
zetaff.- start
Smallest value of the support of the distribution. Must be a positive integer.
Details
The PMF is
$$P(Y=y) = (a/y)^{s} -
(a/(1+y))^{s},\ \ s>0,\ \ y=a,a+1,\ldots,$$
where \(s\) is the positive shape parameter, and \(a\)
is start.
According to Moreno-Sanchez et al. (2016), this model
fits quite well to about 40 percent of all the English books
in the Project Gutenberg data base (about 30,000 texts).
Multiple responses are handled.
Value
An object of class "vglmff"
(see vglmff-class).
The object is used by modelling functions such as
vglm, and vgam.
References
Moreno-Sanchez, I., Font-Clos, F. and Corral, A. (2016). Large-Scale Analysis of Zipf's Law in English Texts, PLoS ONE, 11(1), 1–19.
Examples
odata <- data.frame(x2 = runif(nn <- 1000)) # Artificial data
odata <- transform(odata, shape = loglink(-0.25 + x2, inv = TRUE))
odata <- transform(odata, y1 = rdiffzeta(nn, shape))
with(odata, table(y1))
#> y1
#> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17
#> 574 167 75 48 20 24 7 14 9 10 2 6 6 2 3 5
#> 18 19 20 21 24 27 28 29 30 33 35 37 39 52 53 64
#> 3 2 2 1 1 1 1 2 1 1 1 1 1 1 1 1
#> 99 108 127 132 284 646 2604
#> 1 1 1 1 1 1 1
ofit <- vglm(y1 ~ x2, diffzeta, odata, trace = TRUE)
#> Iteration 1: loglikelihood = -1661.4961
#> Iteration 2: loglikelihood = -1657.9141
#> Iteration 3: loglikelihood = -1657.8819
#> Iteration 4: loglikelihood = -1657.8818
#> Iteration 5: loglikelihood = -1657.8818
coef(ofit, matrix = TRUE)
#> loglink(shape)
#> (Intercept) -0.2078682
#> x2 0.8810210