Learn R Programming

VGAM (version 0.8-1)

pospoisson: Positive Poisson Distribution Family Function

Description

Fits a positive Poisson distribution.

Usage

pospoisson(link = "loge", earg=list(),
           expected=TRUE, ilambda=NULL, method.init=1)

Arguments

link
Link function for the usual mean (lambda) parameter of an ordinary Poisson distribution. See Links for more choices.
earg
List. Extra argument for the link. See earg in Links for general information.
expected
Logical. Fisher scoring is used if expected = TRUE, else Newton-Raphson.
ilambda
Optional initial value for $\lambda$. A NULL means a value is computed internally.
method.init
An integer with value 1 or 2 or 3 which specifies the initialization method for $\lambda$. If failure to converge occurs try another value and/or else specify a value for ilambda.

Value

Warning

Under- or over-flow may occur if the data is ill-conditioned.

Details

The positive Poisson distribution is the ordinary Poisson distribution but with the probability of zero being zero. Thus the other probabilities are scaled up (i.e., divided by $1-P[Y=0]$). The mean, $\lambda / (1 - \exp(-\lambda))$, can be obtained by the extractor function fitted applied to the object.

A related distribution is the zero-inflated Poisson, in which the probability $P[Y=0]$ involves another parameter $\phi$. See zipoisson.

References

Coleman, J. S. and James, J. (1961) The equilibrium size distribution of freely-forming groups. Sociometry, 24, 36--45.

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

See Also

Pospois, posnegbinomial, poissonff, zipoisson.

Examples

Run this code
# Data from Coleman and James (1961)
cjdat = data.frame(y = 1:6, w = c(1486, 694, 195, 37, 10, 1))
fit = vglm(y ~ 1, pospoisson, cjdat, weights=w)
Coef(fit)
summary(fit)
fitted(fit)

# Artificial data
pdat = data.frame(x = runif(nn <- 1000))
pdat = transform(pdat, lambda = exp(1 - 2*x))
pdat = transform(pdat, y = rpospois(nn, lambda))
with(pdat, table(y))
fit = vglm(y ~ x, pospoisson, pdat, trace=TRUE, crit="c")
coef(fit, matrix=TRUE)

Run the code above in your browser using DataLab