Learn R Programming

VGAM (version 0.7-5)

logff: Logarithmic Distribution

Description

Estimating the parameter of the logarithmic distribution.

Usage

logff(link = "logit", earg=list(), init.c = NULL)

Arguments

link
Parameter link function applied to the parameter $c$, which lies between 0 and 1. See Links for more choices.
earg
List. Extra argument for the link. See earg in Links for general information.
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.

Value

  • An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, and vgam.

Details

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,\ldots$, 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-ac) /(1-c)^2$.

References

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.

Documentation accompanying the VGAM package at http://www.stat.auckland.ac.nz/~yee contains further information and examples.

See Also

rlog, log, loge, logoff.

Examples

Run this code
y = rlog(n=1000, prob=logit(0.2, inverse=TRUE))
fit = vglm(y ~ 1, logff, trace=TRUE, crit="c")
coef(fit, matrix=TRUE)
Coef(fit)
hist(y, prob=TRUE, breaks=seq(0.5, max(y)+0.5, by=1))
x = seq(1, max(y), by=1)
lines(x, dlog(x, Coef(fit)[1]), col="red", type="h")

Run the code above in your browser using DataLab