Learn R Programming

VGAM (version 0.7-5)

geometric: Geometric Distribution

Description

Maximum likelihood estimation for the geometric distribution.

Usage

geometric(link = "logit", earg=list(), expected = TRUE)

Arguments

Value

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

Details

A random variable $Y$ has a 1-parameter geometric distribution if $P(Y=y) = p (1-p)^y$ for $y=0,1,2,\ldots$. Here, $p$ is the probability of success, and $Y$ is the number of (independent) trials that are fails until a success occurs. Thus the response $Y$ should be a non-negative integer. The mean of $Y$ is $E(Y) = (1-p)/p$ and its variance is $Var(Y) = (1-p)/p^2$. The geometric distribution is a special case of the negative binomial distribution (see negbinomial).

References

Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.

See Also

negbinomial, Geometric, betageometric, rbetageom.

Examples

Run this code
x1 = runif(n <- 1000) - 0.5
x2 = runif(n) - 0.5
x3 = runif(n) - 0.5
eta = 0.2 - 0.7 * x1 + 1.9 * x2
prob = logit(eta, inverse=TRUE)
y = rgeom(n, prob)
table(y)
fit = vglm(y ~ x1 + x2 + x3, geometric, trace=TRUE, crit="coef")
coef(fit)
coef(fit, mat=TRUE)
summary(fit)

Run the code above in your browser using DataLab