negbinomial(lmu = "loge", lk = "loge",
emu =list(), ek=list(),
ik = NULL, nsimEIM=100,
cutoff = 0.995, Maxiter=5000,
deviance.arg = FALSE, method.init=1,
shrinkage.init=0.95, zero = -2)Links for more choices.
Note that the $k$ parameter is the size argument of
earg in Links for general information.method.init).
For a $S$-column response, ik can be of length $S$.
A value NULL means an initial value for each rCommonVGAMffArguments for more information
and the TRUE, the deviance function
is attached to the object. Under ordinary circumstances, it should
be left alone because it really assumes the index parameter is at
the maximum likelihood estimate. Consequently, one cannot use t1 or 2 or 3 which
specifies the initialization method for the $\mu$ parameter.
If failure to converge occurs try another value
and/or else specify a value for shrinkage.init
lk is applied) is modelled as a single un"vglmff" (see vglmff-class).
The object is used by modelling functions such as vglm
and vgam.poissonff. This function is fragile; the maximum likelihood estimate of the
index parameter is fraught (see Lawless, 1987). In general, the
quasipoissonff is more robust than this function.
Assigning values to the ik argument may lead to a local solution,
and smaller values are preferred over large values when using this argument.
Yet to do: write a family function which uses the methods of moments estimator for $k$.
fitted.values slot of the object contains
the estimated value of the $\mu$ parameter, i.e., of the mean
$E(Y)$. The negative binomial distribution can be coerced into the classical
GLM framework, with one of the parameters being of interest and the
other treated as a nuisance/scale parameter (and implemented in the
MASS library). This negbinomial treats
both parameters on the same footing, and estimates them both by full
maximum likelihood estimation.
Simulated Fisher scoring is employed as the default
(see the nsimEIM argument).
The parameters $\mu$ and $k$ are independent (diagonal EIM), and the confidence region for $k$ is extremely skewed so that its standard error is often of no practical use. The parameter $1/k$ has been used as a measure of aggregation.
This zero=-2 means that all
species have a $k$ equalling a (different) intercept only.
Hilbe, J. M. (2007) Negative Binomial Regression. Cambridge: Cambridge University Press.
Bliss, C. and Fisher, R. A. (1953) Fitting the negative binomial distribution to biological data. Biometrics 9, 174--200.
quasipoissonff,
poissonff,
cao,
cqo,
zinegbinomial,
posnegbinomial,
invbinomial, rnbinom,
nbolf.# Example 1: apple tree data
y = 0:7
w = c(70, 38, 17, 10, 9, 3, 2, 1)
fit = vglm(y ~ 1, negbinomial, weights=w)
summary(fit)
coef(fit, matrix=TRUE)
Coef(fit)
# Example 2: simulated data with multivariate response
x = runif(n <- 500)
y1 = rnbinom(n, mu=exp(3+x), size=exp(1)) # k is size
y2 = rnbinom(n, mu=exp(2-x), size=exp(0))
fit = vglm(cbind(y1,y2) ~ x, negbinomial, trace=TRUE)
coef(fit, matrix=TRUE)
# Example 3: large counts so definitely use the nsimEIM argument
x = runif(n <- 500)
y = rnbinom(n, mu=exp(12+x), size=exp(1)) # k is size
range(y) # Large counts
fit = vglm(y ~ x, negbinomial(nsimEIM=100), trace=TRUE)
coef(fit, matrix=TRUE)Run the code above in your browser using DataLab