bzinb {bzinb} | R Documentation |
random generation (rbzinb
), maximum likelihood estimation (bzinb
),
and log-likelihood. (lik.bzinb
) for the bivariate zero-inflated negative binomial
distribution with parameters equal to (a0, a1, a2, b1, b2, p1, p2, p3, p4)
.
lik.bzinb(xvec, yvec, a0, a1, a2, b1, b2, p1, p2, p3, p4, param = NULL) rbzinb(n, a0, a1, a2, b1, b2, p1, p2, p3, p4, param = NULL) bzinb(xvec, yvec, initial = NULL, tol = 1e-08, maxiter = 50000, showFlag = FALSE, vcov = FALSE)
xvec, yvec |
a pair of bzinb random vectors. nonnegative integer vectors. If not integers, they will be rounded to the nearest integers. |
a0, a1, a2 |
shape parameters of the latent gamma variables. They must be positive. |
b1, b2 |
scale parameters for the latent gamma variables. They must be positive. |
p1, p2, p3, p4 |
proportions summing up to 1 ( |
param |
a vector of parameters ( |
n |
number of observations. |
initial |
starting value of param for EM algorithm, a vector of nine values. |
tol |
tolerance for judging convergence. |
maxiter |
maximum number of iterations allowed. |
showFlag |
if |
vcov |
if |
EM theoretically guarantees higher likelihood at each iteration than that of previous iterations. See Dempster, Laird, and Rubin (1977). This guarantee comes with an assumption that there is no numerical error in conditional likelihood maximization at each iteration. Small errors can cause decreasing likelihood especially when the iterations reach the point of convergence. Due to this technical error, the EM continues after it reaches the maximum likelihood point (up to 100 iterations). However, the final estimate being returned is the parameter values at the maximum likelihood.
rbzinb
gives a pair of random vectors following BZINB distribution.
bzinb
gives the maximum likelihood estimates of a BZINB pair.
rho
estimate and standard error of the underlying correlation (ρ) and (logit(ρ))
coefficients
estimate and standard error of the BZINB parameters
lik
log-likelihood of the maximum likelihood estimate
iter
total number of iterations
info
information matrix. Provided when vcov
is TRUE
.
vcov
variance-covariance matrix. Provided when vcov
is TRUE
.
lik.bzinb
gives the log-likelihood of a set of parameters for a BZINB pair.
Hunyong Cho, Chuwen Liu, Jinyoung Park, and Di Wu
Cho, H., Preisser, J., Liu, C., and Wu, D. (In preparation), "A bivariate zero-inflated negative binomial model for identifying underlying dependence"
Dempster, A. P., Laird, N. M., & Rubin, D. B. (1977). Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society: Series B (Methodological), 39(1), 1-22.
# generating a pair of random vectors set.seed(2) data1 <- rbzinb(n = 100, a0 = 2, a1 = 1, a2 = 1, b1 = 1, b2 = 1, p1 = 0.5, p2 = 0.2, p3 = 0.2, p4 = 0.1) lik.bzinb(xvec = data1[, 1], yvec = data1[ ,2], a0 = 1, a1 = 1, a2 = 1, b1 = 1, b2 = 1, p1 = 0.5, p2 = 0.2, p3 = 0.2, p4 = 0.1) bzinb(xvec = data1[,1], yvec = data1[,2], showFlag = FALSE)