Maximum likelihood estimation for the beta-geometric distribution.
betageometric(lprob = "logit", lshape = "loge",
iprob = NULL, ishape = 0.1,
moreSummation = c(2, 100), tolerance = 1.0e-10, zero = NULL)
Parameter link functions applied to the
parameters prob
and shape
below).
The former lies in the unit interval and the latter is positive.
See Links
for more choices.
Numeric.
Initial values for the two parameters.
A NULL
means a value is computed internally.
Integer, of length 2.
When computing the expected information matrix a series summation from
0 to moreSummation[1]*max(y)+moreSummation[2]
is made, in which the
upper limit is an approximation to infinity.
Here, y
is the response.
Positive numeric. When all terms are less than this then the series is deemed to have converged.
An integer-valued vector specifying which linear/additive predictors are modelled as intercepts only. If used, the value must be from the set {1,2}.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.
A random variable shape1
and shape2
.
The parameterization here is to focus on the parameters
shape
.
The default link functions for these ensure that the appropriate range
of the parameters is maintained.
The mean of shape1 > 1
, and if so, then this is returned as
the fitted values.
The geometric distribution is a special case of the beta-geometric
distribution with geometric
).
However, fitting data from a geometric distribution may result in
numerical problems because the estimate of -Inf
.
Paul, S. R. (2005) Testing goodness of fit of the geometric distribution: an application to human fecundability data. Journal of Modern Applied Statistical Methods, 4, 425--433.
# NOT RUN {
bdata <- data.frame(y = 0:11, wts = c(227,123,72,42,21,31,11,14,6,4,7,28))
fitb <- vglm(y ~ 1, betageometric, data = bdata, weight = wts, trace = TRUE)
fitg <- vglm(y ~ 1, geometric, data = bdata, weight = wts, trace = TRUE)
coef(fitb, matrix = TRUE)
Coef(fitb)
sqrt(diag(vcov(fitb, untransform = TRUE)))
fitb@misc$shape1
fitb@misc$shape2
# Very strong evidence of a beta-geometric:
pchisq(2 * (logLik(fitb) - logLik(fitg)), df = 1, lower.tail = FALSE)
# }
Run the code above in your browser using DataLab