mmzipBvs {mBvs} | R Documentation |
The function to perform variable selection for marginalized multivariate zero-inflated Poisson models
Description
The function can be used to perform variable selection for marginalized multivariate zero-inflated Poisson models.
Usage
mmzipBvs(Y, lin.pred, data, offset = NULL, zero_cutoff = 0.05, hyperParams,
startValues, mcmcParams)
Arguments
Y |
a data.frame containing |
lin.pred |
a list containing three formula objects: the first formula specifies the |
data |
a data.frame containing the variables named in the formulas in |
offset |
an optional numeric vector with an a priori known component to be included as the linear predictor in the count part of model. |
zero_cutoff |
Response variable with proportions of zeros less than |
hyperParams |
(update this)
a list containing lists or vectors for hyperparameter values in hierarchical models. Components include,
|
startValues |
a numeric vector containing starting values for model parameters. See Examples below. |
mcmcParams |
(update this)
a list containing variables required for MCMC sampling. Components include,
|
Value
mmzipBvs
returns an object of class mmzipBvs
.
Author(s)
Kyu Ha Lee, Brent A. Coull, Jacqueline R. Starr
Maintainer: Kyu Ha Lee <klee15239@gmail.com>
References
update this
Examples
## Not run:
# loading a data set
data(simData_mzip)
Y <- simData_mzip$Y
data <- simData_mzip$X
n = dim(Y)[1]
q = dim(Y)[2]
form.bin <- as.formula(~cov.1)
form.count <- as.formula(~cov.1)
form.adj <- as.formula(~1)
form <- list(form.bin, form.count, form.adj)
p_adj = dim(model.frame(form[[3]], data=data))[2]
p0 <- dim(model.frame(form[[1]], data=data))[2] + p_adj
p1 <- dim(model.frame(form[[2]], data=data))[2] + p_adj
#####################
## Hyperparameters ##
Sigma_me <- 0.5
Sigma_var <- 1
rho0 <- 2*Sigma_me^2/Sigma_var+q+3
psi0 <- Sigma_me*(rho0-q-1)
hyperParams_mmzip <- list(v_beta=rep(3, q), omega_beta=rep(0.5, p1-p_adj),
a_beta=rep(0.5, p1), b_beta=rep(0.5, p1), mu_beta0=rep(0, q), a_beta0=0.5, b_beta0=0.5,
v_alpha=rep(3, q), omega_alpha=rep(0.5, p0-p_adj),
a_alpha=rep(0.5, p0), b_alpha=rep(0.5, p0), mu_alpha0=rep(0, q), a_alpha0=0.5, b_alpha0=0.5,
rho0=rho0, Psi0=diag(psi0, q), mu_m=rep(0, q), v_m=0.5)
###################
## MCMC SETTINGS ##
run <- list(numReps=100, thin=1, burninPerc=0.5)
storage <- list(storeV=FALSE, storeW=FALSE)
vs <- list(count=TRUE, binary=TRUE)
tuning <- list(L_group=100, L_m=20, eps_group=0.00001, eps_m=0.00001,
Mvar_group=1, Mvar_m=1, beta_prop_var=0.0001, alpha_prop_var=0.0001)
mcmc_mmzip <- list(run=run, storage=storage, vs=vs, tuning=tuning)
#####################
## Starting Values
startValues_mmzip <- initiate_startValues(form, Y, data, "MMZIP")
#####################
## Other settings
offset <- data$total
zero_cutoff=0.05
#######################
## Fitting the MMZIP ##
#######################
fit.mmzip <- mmzipBvs(Y, form, data, offset, zero_cutoff, hyperParams_mmzip,
startValues_mmzip, mcmc_mmzip)
print(fit.mmzip)
summ.fit.mmzip <- summary(fit.mmzip); names(fit.mmzip)
summ.fit.mmzip
## End(Not run)