poissonff {VGAM}R Documentation

Poisson Family Function

Description

Family function for a generalized linear model fitted to Poisson responses. The dispersion parameters may be known or unknown.

Usage

poissonff(link = "loge", earg=list(), dispersion = 1, onedpar = FALSE,
          imu = NULL, imethod = 1, parallel = FALSE, zero = NULL)

Arguments

link, earg

Link function and extra argument applied to the mean or means. See Links for more choices and information.

dispersion

Dispersion parameter. By default, maximum likelihood is used to estimate the model because it is known. However, the user can specify dispersion = 0 to have it estimated, or else specify a known positive value (or values if the response is a matrix—one value per column).

onedpar

One dispersion parameter? If the response is a matrix, then a separate dispersion parameter will be computed for each response (column), by default. Setting onedpar=TRUE will pool them so that there is only one dispersion parameter to be estimated.

parallel

A logical or formula. Used only if the response is a matrix.

imu, imethod

See CommonVGAMffArguments for more information.

zero

An integer-valued vector specifying which linear/additive predictors are modelled as intercepts only. The values must be from the set {1,2,...,M}, where M is the number of columns of the matrix response.

Details

M

defined above is the number of linear/additive predictors.

If the dispersion parameter is unknown, then the resulting estimate is not fully a maximum likelihood estimate.

A dispersion parameter that is less/greater than unity corresponds to under-/over-dispersion relative to the Poisson model. Over-dispersion is more common in practice.

When fitting a Quadratic RR-VGLM (see cqo), the response is a matrix of M, say, columns (e.g., one column per species). Then there will be M dispersion parameters (one per column of the response matrix) if dispersion = 0 and onedpar = FALSE.

Value

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

Warning

With a multivariate response, assigning a known dispersion parameter for each response is not handled well yet. Currently, only a single known dispersion parameter is handled well.

Note

This function will handle a matrix response automatically.

The call poissonff(dispersion=0, ...) is equivalent to quasipoissonff(...). The latter was written so that R users of quasipoisson() would only need to add a “ff” to the end of the family function name.

Regardless of whether the dispersion parameter is to be estimated or not, its value can be seen from the output from the summary() of the object.

Author(s)

Thomas W. Yee

References

McCullagh, P. and Nelder, J. A. (1989) Generalized Linear Models, 2nd ed. London: Chapman & Hall.

See Also

Links, quasipoissonff, genpoisson, zipoisson, skellam, mix2poisson, cenpoisson, ordpoisson, amlpoisson, invbinomial, loge, polf, rrvglm, cqo, cao, binomialff, quasibinomialff, poisson, poissonp.

Examples

poissonff()

pdat = data.frame(x = rnorm(nn <- 100))
pdat = transform(pdat, y = rpois(nn, exp(1+x)))
(fit = vglm(y ~ x, family = poissonff, pdat))
coef(fit, matrix = TRUE)

nn = 200
cdat = data.frame(x2 = rnorm(nn), x3 = rnorm(nn), x4 = rnorm(nn))
cdat = transform(cdat, lv1 = 0 + x3 - 2*x4)
cdat = transform(cdat, lambda1 = exp(3 - 0.5 *  (lv1-0)^2),
                       lambda2 = exp(2 - 0.5 *  (lv1-1)^2),
                       lambda3 = exp(2 - 0.5 * ((lv1+4)/2)^2))
cdat = transform(cdat, y1 = rpois(nn, lambda1),
                       y2 = rpois(nn, lambda2),
                       y3 = rpois(nn, lambda3))
# vvv p1 = cqo(cbind(y1,y2,y3) ~ x2 + x3 + x4, poissonff, cdat,
# vvv          EqualTol = FALSE, ITol = FALSE)
# vvv summary(p1)  # # Three dispersion parameters are all unity
## Not run:  lvplot(p1, y = TRUE, lcol = 2:4, pch = 2:4, pcol = 2:4, rug = FALSE) 

[Package VGAM version 0.8-4 Index]