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 q count outcomes from n subjects. It is of dimension n\times q.

lin.pred

a list containing three formula objects: the first formula specifies the p_z covariates for which variable selection is to be performed in the binary component of the model; the second formula specifies the p_x covariates for which variable selection is to be performed in the count part of the model; the third formula specifies the p_0 confounders to be adjusted for (but on which variable selection is not to be performed) in the regression analysis.

data

a data.frame containing the variables named in the formulas in lin.pred.

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 zero.cutoff will be removed from the binary model.

hyperParams

(update this) a list containing lists or vectors for hyperparameter values in hierarchical models. Components include, rho0 (degrees of freedom for inverse-Wishart prior for \Sigma_V), Psi0 (a scale matrix for inverse-Wishart prior for \Sigma_V), mu_alpha0 (hyperparameter \mu_{\alpha_0} in the prior of \alpha_0), mu_alpha (a numeric vector of length q for hyperparameter \mu_{\alpha} in the prior of \alpha), mu_beta0 (hyperparameter \mu_{\beta_0} in the prior of \beta_0), mu_beta (a numeric vector of length q for hyperparameter \mu_{\beta} in the prior of \beta), a_alpha0 (hyperparameter a_{\alpha_0} in the prior of \sigma^2_{\alpha_0}), b_alpha0 (hyperparameter b_{\alpha_0} in the prior of \sigma^2_{\alpha_0}), a_alpha (hyperparameter a_{\alpha} in the prior of \sigma^2_{\alpha}), b_alpha (hyperparameter b_{\alpha} in the prior of \sigma^2_{\alpha}), a_beta0 (hyperparameter a_{\beta_0} in the prior of \sigma^2_{\beta_0}), b_beta0 (hyperparameter b_{\beta_0} in the prior of \sigma^2_{\beta_0}), a_beta (hyperparameter a_{\beta} in the prior of \sigma^2_{\beta}), b_beta (hyperparameter b_{\beta} in the prior of \sigma^2_{\beta}), v_beta (a numeric vector of length q for the standard deviation hyperparameter v_{\beta} of the regression parameter \beta prior), omega_beta (a numeric vector of length p_x-p_0 for the hyperparameter \omega_{\beta} in the prior of the variable selection indicator), v_alpha (a numeric vector of length q for the standard deviation hyperparameter v_{\alpha} of the regression parameter \alpha prior), omega_alpha (a numeric vector of length p_z-p_0 for the hyperparameter \omega_{\alpha} in the prior of the variable selection indicator), See Examples below.

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, run (a list containing numeric values for setting the overall run: numReps, total number of scans; thin, extent of thinning; burninPerc, the proportion of burn-in). tuning (a list containing numeric values relevant to tuning parameters for specific updates in Metropolis-Hastings algorithm: beta0.prop.var, variance of the proposal density for \beta_0;beta.prop.var, variance of the proposal density for B;alpha.prop.var, variance of the proposal density for A;V.prop.var, variance of the proposal density for V.) See Examples below.

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)



[Package mBvs version 1.92 Index]