BZINB {BSTZINB} | R Documentation |
Generate posterior samples for the parameters in a Bayesian Zero Inflated Negative Binomial Model
BZINB(y,X,A,
nchain=3,niter=100,nburn=20,nthin=1)
y |
vector of counts, must be non-negative |
X |
matrix of covariates, numeric |
A |
adjacency matrix, numeric |
nchain |
positive integer, number of MCMC chains to be run |
niter |
positive integer, number of iterations in each chain |
nburn |
non-negative integer, number of iterations to be discarded as burn-in samples |
nthin |
positive integer, thinning interval |
list of posterior samples of the parameters of the model
data(simdat)
y <- simdat$y
X <- cbind(simdat$V1,simdat$x)
data(county.adjacency)
data(USAcities)
IAcities <- subset(USAcities,state_id=="IA")
countyname <- unique(IAcities$county_name)
A <- get_adj_mat(county.adjacency,countyname,c("IA"))
res1 <- BSTZINB(y, X, A, nchain=2, niter=100, nburn=20, nthin=1)