| bnb {bzinb} | R Documentation | 
The bivariate negative binomial distribution
Description
random generation (rbnb), maximum likelihood estimation (bnb), 
and log-likelihood. (lik.bnb)  for the bivariate negative binomial 
distribution with parameters equal to (a0, a1, a2, b1, b2).
Usage
lik.bnb(xvec, yvec, a0, a1, a2, b1, b2, param = NULL)
rbnb(n, a0, a1, a2, b1, b2, param = NULL)
bnb(
  xvec,
  yvec,
  em = TRUE,
  tol = 1e-08,
  maxiter = 50000,
  vcov = TRUE,
  initial = NULL,
  showFlag = FALSE
)
Arguments
xvec, yvec | 
 a pair of bnb 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. must be positive.  | 
b1, b2 | 
 scale parameters for the latent gamma variables. must be positive.  | 
param | 
 a vector of parameters (  | 
n | 
 number of observations.  | 
em | 
 if   | 
tol, maxiter, vcov, initial, showFlag | 
 optional arguments applied only when   | 
Value
-  
rbnbgives a pair of random vectors following BNB distribution. -  
bnbgives the maximum likelihood estimates of a BNB pair. Standard error and covariance matrix are provided whenemisTRUE. -  
lik.bnbgives the log-likelihood of a set of parameters for a BNB pair. 
Author(s)
Hunyong Cho, Chuwen Liu, Jinyoung Park, and Di Wu
References
Cho, H., Liu, C., Preisser, J., and Wu, D. (In preparation), "A bivariate zero-inflated negative binomial model for identifying underlying dependence"
Examples
# generating a pair of random vectors
set.seed(1)
data1 <- rbnb(n = 100, a0 = 2, a1 = 1, a2 = 1, 
                b1 = 1, b2 = 1)
lik.bnb(xvec = data1[, 1], yvec = data1[ ,2], 
          a0 = 1, a1 = 1, a2 = 1, b1 = 1, b2 = 1) 
bnb(xvec = data1[,1], yvec = data1[,2], showFlag = FALSE)