negbinomial(lmu = "loge", lk = "loge",
emu =list(), ek=list(),
ik = NULL, cutoff = 0.995, Maxiter=5000,
deviance.arg = FALSE, method.init=1,
shrinkage.init=0.95, zero = -2)
Links
for more choices.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 rTRUE
, 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
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
and/or else specilk
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.
The parameters $\mu$ and $k$ are independent (diagonal expected information matrix), 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.
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
.y = 0:7 # Example 1: apple tree data
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)
x = runif(n <- 500) # Example 2: simulated data with multivariate response
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)
Run the code above in your browser using DataLab