| gaitlog.mix {VGAM} | R Documentation |
Fits a generally–altered, –inflated and –truncated logarithmic regression (mixtures of logarithmic distributions on nested and/or partitioned supports).
gaitlog.mix(alter = NULL, inflate = NULL, truncate = NULL,
max.support = Inf, zero = c("pobs.a", "pstr.i"),
eq.ap = FALSE, eq.ip = FALSE, lshape.p = "logitlink",
lpobs.a = "logitlink", lshape.a = "logitlink",
lpstr.i = "logitlink", lshape.i = "logitlink",
type.fitted = c("mean", "pobs.a", "pstr.i", "Pobs.a", "Pstr.i",
"prob.a", "prob.i", "prob.t", "lhs.prob"),
imethod = 1, gshape.p = -expm1(-7 * ppoints(12)), ishape.p = NULL,
ishape.a = NULL, ishape.i = NULL,
ipobs.a = NULL, ipstr.i = NULL, ishrinkage = 0.95, probs.y = 0.35)
alter, inflate, truncate |
See |
lshape.p, lshape.a, lshape.i |
Link functions.
See |
lpobs.a, lpstr.i |
Link functions.
See |
eq.ap, eq.ip |
Single logical each.
See |
type.fitted, max.support |
See |
imethod, ipobs.a, ipstr.i |
See |
gshape.p, ishape.p |
See |
ishape.a, ishape.i |
See |
probs.y, ishrinkage |
See |
zero |
See |
Although the full GAIT–Log–Log–Log model may be fitted,
the two submodels that may be fitted can be abbreviated
GAT–Log–Log or
GIT–Log–Log,
which is where the inner distribution for
ordinary values is the logarithmic distribution, and
the outer distribution for the altered or inflated values
is another logarithmic distribution with a different shape parameter
by default.
Thus for the GAT model
the distribution being fitted is a (spliced) mixture
of two logarithmic with differing (partitioned) support.
Likewise, for the GIT model
the distribution being fitted is a mixture
of two logarithmic with nested support.
Two shape parameters at a time may be constrained to be equal using
eq.ap or eq.ip.
For the GIT model,
by default, a logistic regression models the (structural)
probability pstr.i that the response is inflated.
This function currently does not handle multiple responses.
Further details are at Gaitlog.
For the GIT model,
the ordering of the linear/additive predictors corresponds to
length(inflate) equalling 0, 1, and more than 1;
the dimension grows accordingly.
The same idea holds for the GAT model.
Apart from the order of the linear/additive predictors,
the following are (or should be) equivalent:
gaitlog.mix() and logff(),
gaitlog.mix(alter = 1) and oalog(zero = "pobs1"),
gaitlog.mix(inflate = 1) and oilog(zero = "pstr1"),
gaitlog.mix(truncate = 1) and otlog().
An object of class "vglmff" (see vglmff-class).
The object is used by modelling functions such as vglm,
and vgam.
See gaitpoisson.mix
See gaitpoisson.mix
T. W. Yee
Gaitlog,
gaitpoisson.mix,
gaitpoisson.mlm,
oalog,
oilog,
otlog,
CommonVGAMffArguments,
rootogram4,
simulate.vlm.
avec <- c(5, 10) # Alter these values
ivec <- c(3, 15) # Inflate these values
tvec <- c(6, 7) # Truncate these values
max.support <- 20; set.seed(1)
pobs.a <- logitlink(-1, inverse = TRUE) # About 0.27
pstr.i <- logitlink(-1, inverse = TRUE) # About 0.27
gdata <- data.frame(x2 = runif(nn <- 1000))
gdata <- transform(gdata, shape.p = logitlink(2+0.5*x2, inverse = TRUE))
gdata <- transform(gdata,
y1 = rgaitlog(nn, shape.p, alter.mix = avec, pobs.mix.a = pobs.a,
inflate.mix = ivec, pstr.mix.i = pstr.i, truncate = tvec,
max.support = max.support))
gaitlog.mix(alter = avec, inflate = ivec, max.support = max.support)
with(gdata, table(y1))
gaitlxfit <- vglm(y1 ~ x2, crit = "coef", trace = TRUE, data = gdata,
gaitlog.mix(inflate = ivec, truncate = tvec,
max.support = max.support,
alter = avec, eq.ap = TRUE, eq.ip = TRUE))
head(fitted(gaitlxfit, type.fitted = "Pstr.i"))
head(predict(gaitlxfit))
coef(gaitlxfit, matrix = TRUE)
summary(gaitlxfit)