| oazeta | R Documentation |
Fits a one-altered zeta distribution based on a conditional model involving a Bernoulli distribution and a 1-truncated zeta distribution.
oazeta(lpobs1 = "logitlink", lshape = "loglink",
type.fitted = c("mean", "shape", "pobs1", "onempobs1"),
gshape = exp((-4:3)/4), ishape = NULL, ipobs1 = NULL, zero = NULL)
lpobs1 |
Link function for the parameter |
lshape |
See |
type.fitted |
See |
gshape, ishape, ipobs1, zero |
See |
The response Y is one with probability p_1,
or Y has a 1-truncated zeta distribution with
probability 1-p_1. Thus 0 < p_1 < 1,
which is modelled as a function of the covariates. The one-altered
zeta distribution differs from the one-inflated
zeta distribution in that the former has ones coming from one
source, whereas the latter has ones coming from the zeta
distribution too. The one-inflated zeta distribution
is implemented in the VGAM package. Some people
call the one-altered zeta a hurdle model.
The input can be a matrix (multiple responses).
By default, the two linear/additive predictors
of oazeta are
(logit(\phi), log(shape))^T.
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 \mu (default) which is given by
\mu = \phi + (1-\phi) A
where A is the mean of the one-truncated
zeta distribution.
If type.fitted = "pobs1" then p_1 is returned.
This family function effectively combines
binomialff and
otzeta into
one family function.
T. W. Yee
Oazeta,
zetaff,
oizeta,
otzeta,
CommonVGAMffArguments,
simulate.vlm.
## Not run: odata <- data.frame(x2 = runif(nn <- 1000))
odata <- transform(odata, pobs1 = logitlink(-1 + 2*x2, inverse = TRUE),
shape = loglink( 1 + 1*x2, inverse = TRUE))
odata <- transform(odata, y1 = roazeta(nn, shape = shape, pobs1 = pobs1),
y2 = roazeta(nn, shape = shape, pobs1 = pobs1))
with(odata, table(y1))
ofit <- vglm(cbind(y1, y2) ~ x2, oazeta, data = odata, trace = TRUE)
coef(ofit, matrix = TRUE)
head(fitted(ofit))
head(predict(ofit))
summary(ofit)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.