ZIPMErr {ZIPBayes} | R Documentation |
Zero-inflated Poisson model with measurement error
Description
The function implements the MCMC algorithm with data augmentation to estimate the parameters in the zero-inflated Poisson model while correcting for the measurement error arising from the responses. The function returns the trace of the sampled parameters in each iteraction. To obtain the summary estimation, use summary
().
Usage
ZIPMErr (Ystar, Covarmainphi, Covarmainmu, Covarplus, Covarminus,
betaphi, betamu, alphaplus, alphaminus,
Uibound = c(7,11),
priorgamma, priormu, priorSigma, propsigmaphi, propsigmamu = propsigmaphi,
propsigmaplus = propsigmaphi, propsigmaminus = propsigmaphi,
seed = 1, nmcmc = 500)
Arguments
Ystar |
a count vector of length |
Covarmainphi |
a |
Covarmainmu |
a |
Covarplus |
a |
Covarminus |
a |
betaphi |
a vector of length |
betamu |
a vector of length |
alphaplus |
a vector of length |
alphaminus |
a vector of length |
Uibound |
a vector of length |
priorgamma |
a vector of length |
priormu |
a vector of length |
priorSigma |
a vector of length |
propsigmaphi |
a vector of length |
propsigmamu |
a vector of length |
propsigmaplus |
a vector of length |
propsigmaminus |
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). Although there are might arugments involved in the functions, they can be summarized to four sources in the model. The response model (zero-inflated Poisson model) involves two components: the probability component and the mean count component. The measurement error models contains two process: the add-in process and leave-out process. The arguements end with "-phi" corresponds to the probability component of the response model. The arguements end with "-mu" corresponds to the mean component of the response model. The arguements end with "-plus" corresponds to the add-in error process in the measurment error model. The arguements end with "-minus" corresponds to the leave-out process of the measurement error model.
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. Data frames "alphaplus_trace" and "alphaminus_trace", respectively, correspond to the add-in error and leave-out error process in the measruement error 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
## load data
data(datasim)
set.seed(0)
example_ZIP_MErr <- ZIPMErr (Ystar = datasim$Ystar,
Covarmainphi = datasim[,c("intercept","X1")],
Covarmainmu = datasim[,c("intercept","X2")],
Covarplus = datasim[,c("intercept","Xplus")],
Covarminus = datasim[,c("intercept","Xminus")],
betaphi = c(0.7,-0.7), betamu = c(1,-1.5),
alphaplus = c(0,0), alphaminus=c(0,0),
priorgamma = c(0.001,0.001), priormu = c(0,0),
priorSigma = c(1,1), propsigmaphi = c(0.05,0.05),
nmcmc = 10)
summary(example_ZIP_MErr)