logff {VGAM} | R Documentation |
Logarithmic Distribution
Description
Estimating the (single) parameter of the logarithmic distribution.
Usage
logff(lshape = "logitlink", gshape = -expm1(-7 * ppoints(4)),
zero = NULL)
Arguments
lshape |
Parameter link function for the parameter |
gshape , zero |
Details at |
Details
The logarithmic distribution is
a generalized power series distribution that is
based specifically on the logarithmic series
(scaled to a probability function).
Its probability function is
, for
,
where
(called
shape
),
and .
The mean is
(returned as the fitted values)
and variance is
.
When the sample mean is large, the value of
tends to
be very close to 1, hence it could be argued that
logitlink
is not the best choice.
Value
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.
Note
The function log
computes the natural
logarithm. In the VGAM library, a link function with option
loglink
corresponds to this.
Multiple responses are permitted.
The “logarithmic distribution” has various meanings in
the literature. Sometimes it is also called the
log-series distribution.
Some others call some continuous distribution on
by the name “logarithmic distribution”.
Author(s)
T. W. Yee
References
Johnson N. L., Kemp, A. W. and Kotz S. (2005). Univariate Discrete Distributions, 3rd edition, ch.7. Hoboken, New Jersey: Wiley.
Forbes, C., Evans, M., Hastings, N. and Peacock, B. (2011) Statistical Distributions, Hoboken, NJ, USA: John Wiley and Sons, Fourth edition.
See Also
Log
,
gaitdlog
,
oalog
,
oilog
,
otlog
,
log
,
loglink
,
logofflink
,
explogff
,
simulate.vlm
.
Examples
nn <- 1000
ldata <- data.frame(y = rlog(nn, shape = logitlink(0.2, inv = TRUE)))
fit <- vglm(y ~ 1, logff, data = ldata, trace = TRUE, crit = "c")
coef(fit, matrix = TRUE)
Coef(fit)
## Not run: with(ldata, spikeplot(y, col = "blue", capped = TRUE))
x <- seq(1, with(ldata, max(y)), by = 1)
with(ldata, lines(x + 0.1, dlog(x, Coef(fit)[1]), col = "orange",
type = "h", lwd = 2))
## End(Not run)
# Example: Corbet (1943) butterfly Malaya data
corbet <- data.frame(nindiv = 1:24,
ofreq = c(118, 74, 44, 24, 29, 22, 20, 19, 20, 15, 12,
14, 6, 12, 6, 9, 9, 6, 10, 10, 11, 5, 3, 3))
fit <- vglm(nindiv ~ 1, logff, data = corbet, weights = ofreq)
coef(fit, matrix = TRUE)
shapehat <- Coef(fit)["shape"]
pdf2 <- dlog(x = with(corbet, nindiv), shape = shapehat)
print(with(corbet, cbind(nindiv, ofreq, fitted = pdf2 * sum(ofreq))),
digits = 1)