Generally–Altered, –Inflated and –Truncated Zeta Regression
Fits a generally–altered, –inflated and –truncated zeta regression by MLE. The GAIT combo model having 5 types of special values is implemented. This allows mixtures of zetas on nested and/or partitioned support as well as a multinomial logit model for altered and inflated values.
gaitzeta(alt.mix = NULL, inf.mix = NULL, alt.mlm = NULL,
inf.mlm = NULL, truncate = NULL, max.support = Inf,
zero = c("pobs", "pstr"), eq.ap = FALSE, eq.ip = FALSE,
parallel.ap = FALSE, parallel.ip = FALSE, lshape.p = "loglink",
lshape.a = lshape.p, lshape.i = lshape.p,
type.fitted = c("mean", "shapes", "pobs.mlm", "pstr.mlm",
"pobs.mix", "pstr.mix", "Pobs.mix", "Pstr.mix", "nonspecial",
"Numer", "Denom.p", "sum.mlm.i", "sum.mix.i", "ptrunc.p",
"cdf.max.s"), gshape.p = 1 + exp(-seq(7)),
gpstr.mix = ppoints(7) / 3,
gpstr.mlm = ppoints(7) / (3 + length(inf.mlm)), imethod = 1,
imux = 0.5, ishape.p = NULL, ishape.a = ishape.p,
ishape.i = ishape.p, ipobs.mix = NULL, ipstr.mix = NULL,
ipobs.mlm = NULL, ipstr.mlm = NULL, byrow.ai = FALSE,
ishrinkage = 0.95, probs.y = 0.35)truncate, max.support |
See |
alt.mix, inf.mix |
See |
alt.mlm, inf.mlm |
See |
lshape.p, lshape.a, lshape.i |
Link functions.
See |
eq.ap, eq.ip |
Single logical each.
See |
parallel.ap, parallel.ip |
Single logical each.
See |
type.fitted, imux |
See |
imethod, ipobs.mix, ipstr.mix |
See |
ipobs.mlm, ipstr.mlm, byrow.ai |
See |
gpstr.mix, gpstr.mlm |
See |
gshape.p, ishape.p |
See |
ishape.a, ishape.i |
See |
probs.y, ishrinkage |
See |
zero |
See |
Many details to this family function can be found
in gaitpoisson because it is also a 1-parameter
discrete distribution.
This function currently does not handle multiple responses.
Further details are at Gaitzeta.
Apart from the order of the linear/additive predictors,
the following are (or should be) equivalent:
gaitzeta() and zetaff(),
gaitzeta(alt.mix = 1) and oazeta(zero = "pobs1"),
gaitzeta(inf.mix = 1) and oizeta(zero = "pstr1"),
gaitzeta(truncate = 1) and otzeta().
The functions
oazeta,
oizeta and
otzeta
have been placed in VGAMdata.
An object of class "vglmff" (see vglmff-class).
The object is used by modelling functions such as vglm,
rrvglm
and vgam.
See gaitpoisson.
See gaitpoisson.
T. W. Yee
## Not run:
avec <- c(5, 10) # Alter these values parametrically
ivec <- c(3, 15) # Inflate these values
tvec <- c(6, 7) # Truncate these values
set.seed(1); pobs.mix <- pstr.mix <- 0.1
gdata <- data.frame(x2 = runif(nn <- 1000))
gdata <- transform(gdata, shape.p = loglink(0.1+0.1*x2, inverse = TRUE))
gdata <- transform(gdata,
y1 = rgaitzeta(nn, shape.p, alt.mix = avec, pobs.mix = pobs.mix,
inf.mix = ivec, pstr.mix = pstr.mix, truncate = tvec))
gaitzeta(alt.mix = avec, inf.mix = ivec, max.support = max.support)
with(gdata, table(y1))
spikeplot(with(gdata, y1), col = "pink2", log = "x")
gaitzxfit <- vglm(y1 ~ x2, crit = "coef", trace = TRUE, data = gdata,
gaitzeta(inf.mix = ivec, truncate = tvec,
alt.mix = avec, eq.ap = TRUE, eq.ip = TRUE))
head(fitted(gaitzxfit, type.fitted = "Pstr.mix"))
head(predict(gaitzxfit))
t(coef(gaitzxfit, matrix = TRUE)) # Easier to see with t()
summary(gaitzxfit, HDEtest = FALSE) # summary(gaitzxfit) is better
## End(Not run)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.