ZIP {ZIPBayes} | R Documentation |
zero-inflated Poisson model
Description
The function implements the MCMC algorithm with data augmentation to estimate the parameters in the zero-inflated Poisson model. The function returns the trace of the sampled parameters in each interaction. To obtain the summary estimation, use summary
().
Usage
ZIP(Y, Covarmainphi, Covarmainmu,
betaphi, betamu,
priorgamma,
propsigmaphi, propsigmamu = propsigmaphi,
seed = 1, nmcmc = 500)
Arguments
Y |
a count vector of length |
Covarmainphi |
a |
Covarmainmu |
a |
betaphi |
a vector of length |
betamu |
a vector of length |
priorgamma |
a vector of length |
propsigmaphi |
a vector of length |
propsigmamu |
a vector of length |
seed |
a numeric value specifying the seed for random generator |
nmcmc |
a integer specify the number of the generation of MCMC algorithm |
Details
The zero-inflated Poisson model involves two components, the probability components and the mean compoenents (Zhang, 2020). Argument Covarmainphi
, betaphi
, propsigmaphi
correspond to the probability compoenent; Covarmainmu
, betamu
, propsigmamu
correspond to the mean compoenent.
Value
BayesResults |
the list of trace of generated parameters for each component of the models. Data.frame "betaphi_trace" corresponds to the probability component of ZIP response model; "betamu_trace" refers to the mean component of the ZIP response model. |
Author(s)
Qihuang Zhang and Grace Y. Yi
References
Zhang, Qihuang. "Inference Methods for Noisy Correlated Responses with Measurement Error." (2020).
See Also
Examples
data(datasim)
set.seed(0)
example_ZIP <- ZIP( Y = datasim$Ystar,
Covarmainphi = datasim[,c("intercept","X1")],
Covarmainmu = datasim[,c("intercept","X2")],
betaphi = c(-0.7,0.7), betamu = c(1,-0.5),
priorgamma = rep(1,1), propsigmaphi = c(0.05,0.05),
nmcmc = 100)
summary(example_ZIP)