genipoisson {VGAM} | R Documentation |
Fits a generally-inflated Poisson distribution based on a mixture model involving a multinomial distribution and a Poisson distribution.
genipoisson(inflate = 0, zero = NULL, llambda = "loglink", type.fitted = c("mean", "lambda", "pstr.i", "onempstr.i"), imethod = 1, mux.inflate = 0.5, ipstr0 = NULL, ilambda = NULL, ishrinkage = 0.95, probs.y = 0.35)
inflate |
Vector of inflated values, i.e., nonnegative integers.
Must have unique values only.
May be a |
llambda |
See |
type.fitted |
See |
mux.inflate |
Numeric, between 0 and 1. For the initial values of the multinomial probabilities, the sample proportions are multiplied by this multiplication factor to estimate the amount of inflation. The default is to assume that half of all the inflated values are due to inflation, and the other half from the Poisson distribution. A value close to 1 is recommended for severe amounts of inflation. |
imethod, ipstr0, ilambda |
See |
probs.y, ishrinkage |
See |
zero |
See |
The generally-inflated Poisson distribution is a mixture
of an ordinary Poisson
distribution and the probability of certain values
(inflate
argument) being inflated by a multinomial distribution.
The latter is modelled by a multinomial logit model.
Thus each inflated value has two sources: either from the Poisson
distribution or the multinomial distribution.
The 0-inflated Poisson distribution is a special case
and is the default.
This family function can be easily misused.
The data should exhibit strong evidence of inflation in
certain values before the inflate
argument is assigned these
values.
Deflation or very little inflation will result in numerical problems.
The inflate
argument should not be assigned a vector
having too many values.
Probably genapoisson
is recommended in general
instead as it handles deflation and inflation.
This function implements Fisher scoring and currently does not handle multiple responses.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.
The fitted.values
slot of the fitted object,
which should be extracted by the generic function fitted
,
returns the mean (default).
The choice type.fitted = "pstr.i"
returns the sum of all
the inflated probabilities.
This family function does not yet have the robustness of
multinomial
when computing the working weight matrices.
Several improvements are needed, e.g.,
better labelling and initial values and handling multiple responses.
And summaryvglm
does not work yet on these fitted
models.
T. W. Yee and Chenchen Ma
Genipois
,
genapoisson
,
gentpoisson
,
zipoisson
,
zipoissonff
,
multinomial
,
CommonVGAMffArguments
,
simulate.vlm
.
ivec <- c(0, 3) # Inflate these values gdata <- data.frame(x2 = runif(nn <- 1000)) gdata <- transform(gdata, x3 = runif(nn)) gdata <- transform(gdata, lambda1 = exp(1 + 2 * x2 + 0.5 * x3), lambda2 = exp(1 - 1 * x2 + 0.5 * x3), lambda3 = exp(1)) gdata <- transform(gdata, y1 = rgenipois(nn, lambda1, pstr.i = c(0.2, 0.3), byrow = TRUE, inflate = ivec), y2 = rgenipois(nn, lambda2, pstr.i = c(0.2, 0.3), byrow = TRUE, inflate = ivec), y3 = rgenipois(nn, lambda3, pstr.i = c(0.2, 0.3), byrow = TRUE, inflate = ivec)) genipoisson(inflate = ivec) with(gdata, table(y1)) with(gdata, table(y2)) with(gdata, table(y3)) fit1 <- vglm(y1 ~ x2 + x3, genipoisson(inflate = ivec), crit = "coef", trace = TRUE, data = gdata) head(fitted(fit1)) head(predict(fit1)) coef(fit1, matrix = TRUE) # summary(fit1) # Currently does not work!! # Another example ------------------------------ fit3 <- vglm(y3 ~ 1, genipoisson(inflate = ivec), gdata, trace = TRUE) coef(fit3, matrix = TRUE)