gentpoisson {VGAM} | R Documentation |
Fits a generally-truncated Poisson distribution to produce MLEs.
gentpoisson(truncate = 0, zero = NULL, max.support = Inf, link = "loglink", type.fitted = c("mean", "lambda", "prob.t"), ilambda = NULL, imethod = 1)
truncate |
Vector of truncated values, i.e., nonnegative integers.
Must have unique values only.
May be a |
link, zero, ilambda, imethod |
See |
max.support |
See |
type.fitted |
See |
The generally-truncated Poisson distribution is the ordinary Poisson
distribution with the probability of certain values
(truncate
argument) being zero. Thus the
other probabilities are scaled up.
The (0-truncated) positive-Poisson distribution is a special case
and is the default.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
rrvglm
and vgam
.
Under- or over-flow may occur if the data is ill-conditioned.
The response is checked to see that no values equal
any values of the truncate
vector.
It is easy to misuse this function;
the truncate
vector should ideally not be very long and
have values that can be justified by the application on hand.
Hopefully soon, the ability to handle
RHS-truncation will be allowed,
i.e., something equivalent to
truncate = (U+1):Inf
for some upper support point U
.
This family function can handle multiple responses.
Thomas W. Yee and Chenchen Ma
Gentpois
,
genapoisson
,
genipoisson
,
Pospois
,
pospoisson
,
poissonff
,
otpospoisson
,
zapoisson
,
zipoisson
,
simulate.vlm
.
nnn <- 1000; tvec <- c(2, 3, 4) # Truncate these values rdata <- data.frame(x2 = runif(nnn), x3 = runif(nnn)) rdata <- transform(rdata, lambda1 = exp(1 + 2 * x2 + 0.5 * x3), lambda2 = exp(1 - 1 * x2 + 0.5 * x3)) rdata <- transform(rdata, y1 = rgentpois(nnn, lambda1, trunc = tvec), y2 = rgentpois(nnn, lambda2, trunc = tvec)) with(rdata, table(y1)) with(rdata, table(y2)) fit1 <- vglm(cbind(y1, y2) ~ x2 + x3, crit = "coef", gentpoisson(truncate = tvec), trace = TRUE, data = rdata) coef(fit1, matrix = TRUE) summary(fit1)