invbinomial {VGAM} | R Documentation |
Estimates the two parameters of an inverse binomial distribution by maximum likelihood estimation.
invbinomial(lrho="elogit", llambda="loge", erho=if(lrho=="elogit") list(min = 0.5, max = 1) else list(), elambda=list(), irho=NULL, ilambda=NULL, zero=NULL)
lrho, llambda |
Link function for the rho and lambda parameters.
See Links for more choices.
|
erho, elambda |
List. Extra argument for each of the links.
See earg in Links for general information.
|
irho, ilambda |
Numeric.
Optional initial values for rho and lambda.
|
zero |
See CommonVGAMffArguments .
|
The inverse binomial distribution of Yanagimoto (1989) has density function
f(y;rho,lambda) = (lambda * Gamma(2y+lambda)) * [rho*(1-rho)]^y * rho^lambda / (Gamma(y+1) * Gamma(y+lambda+1))
where y=0,1,2,... and 0.5 < rho < 1, and lambda > 0. The first two moments exist for rho>0.5; then the mean is lambda*(1-rho)/(2*rho-1) (returned as the fitted values) and the variance is lambda*rho*(1-rho)/(2*rho-1)^3. The inverse binomial distribution is a special case of the generalized negative binomial distribution of Jain and Consul (1971). It holds that Var(Y) > E(Y) so that the inverse binomial distribution is overdispersed compared with the Poisson distribution.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.
This VGAM family function only works reasonably well with
intercept-only models.
Good initial values are needed; if convergence failure occurs use
irho
and/or ilambda
.
Some elements of the working weight matrices use the expected information matrix while other elements use the observed information matrix. Yet to do: using the mean and the reciprocal of lambda results in a EIM that is diagonal.
T. W. Yee
Yanagimoto, T. (1989) The inverse binomial distribution as a statistical model. Communications in Statistics: Theory and Methods, 18, 3625–3633.
Jain, G. C. and Consul, P. C. (1971) A generalized negative binomial distribution. SIAM Journal on Applied Mathematics, 21, 501–513.
Jorgensen, B. (1997) The Theory of Dispersion Models. London: Chapman & Hall
y <- rnbinom(n <- 1000, mu=exp(3), size=exp(1)) fit <- vglm(y ~ 1, invbinomial, trace=TRUE) c(mean(y), fitted(fit)[1:5]) summary(fit) coef(fit, matrix=TRUE) Coef(fit) sum(weights(fit)) # sum of the prior weights sum(weights(fit, type="w")) # sum of the working weights