| logff {VGAM} | R Documentation |
Estimating the (single) parameter of the logarithmic distribution.
logff(link = "logit", earg=list(), init.c = NULL)
link |
Parameter link function applied to the parameter c,
which lies between 0 and 1.
See |
earg |
List. Extra argument for the link.
See |
init.c |
Optional initial value for the c parameter. If given, it often pays to start with a larger value, e.g., 0.95. The default is to choose an initial value internally. |
The logarithmic distribution is based on the logarithmic series, and is scaled to a probability function. Its probability function is f(y) = a * c^y / y, for y=1,2,3,..., where 0 < c < 1, and a = -1 / log(1-c). The mean is a*c/(1-c) (returned as the fitted values) and variance is a*c*(1-a*c)/(1-c)^2.
An object of class "vglmff" (see vglmff-class).
The object is used by modelling functions such as vglm,
and vgam.
The function log computes the natural logarithm.
In the VGAM library, a link function with option
loge corresponds to this.
The logarithmic distribution is sometimes confused with the log-series distribution. The latter was used by Fisher et al. for species abundance data, and has two parameters.
T. W. Yee
Chapter 7 of Johnson N. L., Kemp, A. W. and Kotz S. (2005) Univariate Discrete Distributions, 3rd edition, Hoboken, New Jersey: Wiley.
Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.
rlog,
log,
loge,
logoff,
explogarithmic.
ldata = data.frame(y = rlog(n = 1000, prob = logit(0.2, inverse = TRUE)))
fit = vglm(y ~ 1, logff, ldata, trace = TRUE, crit = "c")
coef(fit, matrix = TRUE)
Coef(fit)
## Not run: with(ldata,
hist(y, prob = TRUE, breaks = seq(0.5, max(y) + 0.5, by = 1),
border = "blue"))
x = seq(1, with(ldata, max(y)), by=1)
with(ldata, lines(x, 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)
chat = Coef(fit)["c"]
pdf2 = dlog(x = with(corbet, nindiv), prob = chat)
print(with(corbet, cbind(nindiv, ofreq, fitted = pdf2 * sum(ofreq))), dig = 1)