Last chance! 50% off unlimited learning
Sale ends in
zigeometric(lpstr0 = "logit", lprob = "logit",
type.fitted = c("mean", "pobs0", "pstr0", "onempstr0"),
ipstr0 = NULL, iprob = NULL,
imethod = 1, bias.red = 0.5, zero = NULL)
zigeometricff(lprob = "logit", lonempstr0 = "logit",
type.fitted = c("mean", "pobs0", "pstr0", "onempstr0"),
iprob = NULL, ionempstr0 = NULL,
imethod = 1, bias.red = 0.5, zero = -2)
prob
).
The usual geometric probability parameter is the latter.
The probability of a structural zero is the former.
See Links
for morpstr0
.
It should lie between 0 and 1, with 1 having no effect.CommonVGAMffArguments
and fittedvlm
for information.CommonVGAMffArguments
for information.CommonVGAMffArguments
for information."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.zigeometric()
is based on
zipoisson
;
see fittedvlm
for information.
The zigeometricff()
has a few
changes compared to zigeometric()
.
These are:
(i) the order of the linear/additive predictors is switched so the
geometric probability comes first;
(ii) argument onempstr0
is now 1 minus
the probability of a structural zero, i.e.,
the probability of the parent (geometric) component,
i.e., onempstr0
is 1-pstr0
;
(iii) argument zero
has a new default so that the onempstr0
is intercept-only by default.
Now zigeometricff()
is generally recommended over
zigeometric()
.
Both functions implement Fisher scoring and can handle
multiple responses.
rzigeom
,
geometric
,
zageometric
,
rgeom
,
simulate.vlm
.gdata <- data.frame(x2 = runif(nn <- 1000) - 0.5)
gdata <- transform(gdata, x3 = runif(nn) - 0.5,
x4 = runif(nn) - 0.5)
gdata <- transform(gdata, eta1 = 1.0 - 1.0 * x2 + 2.0 * x3,
eta2 = -1.0,
eta3 = 0.5)
gdata <- transform(gdata, prob1 = logit(eta1, inverse = TRUE),
prob2 = logit(eta2, inverse = TRUE),
prob3 = logit(eta3, inverse = TRUE))
gdata <- transform(gdata, y1 = rzigeom(nn, prob1, pstr0 = prob3),
y2 = rzigeom(nn, prob2, pstr0 = prob3),
y3 = rzigeom(nn, prob2, pstr0 = prob3))
with(gdata, table(y1))
with(gdata, table(y2))
with(gdata, table(y3))
head(gdata)
fit1 <- vglm(y1 ~ x2 + x3 + x4, zigeometric(zero = 1), data = gdata, trace = TRUE)
coef(fit1, matrix = TRUE)
head(fitted(fit1, type = "pstr0"))
fit2 <- vglm(cbind(y2, y3) ~ 1, zigeometric(zero = 1), data = gdata, trace = TRUE)
coef(fit2, matrix = TRUE)
summary(fit2)
Run the code above in your browser using DataLab