Bayenet {Bayenet}R Documentation

fit a robust Bayesian elastic net variable selection model for genetic study.

Description

fit a robust Bayesian elastic net variable selection model for genetic study.

Usage

Bayenet(
  X,
  Y,
  clin,
  max.steps = 10000,
  robust = TRUE,
  sparse = TRUE,
  penalty = c("lasso", "elastic net"),
  debugging = FALSE
)

Arguments

X

the matrix of predictors (genetic factors). Each row should be an observation vector.

Y

the continuous response variable.

clin

a matrix of clinical variables. Clinical variables are not subject to penalize. Clinical variables will be centered and a column of 1 will be added to the Clinical matrix as the intercept.

max.steps

the number of MCMC iterations.

robust

logical flag. If TRUE, robust methods will be used.

sparse

logical flag. If TRUE, spike-and-slab priors will be used to shrink coefficients of irrelevant covariates to zero exactly.

penalty

two choices are available. "lasso" for lasso penalty. "elastic net" for elastic net penalty.

debugging

logical flag. If TRUE, progress will be output to the console and extra information will be returned.

Details

Consider the data model described in "dat":

Y_{i} = \alpha_{0} + \sum_{k=1}^{q}\gamma_{k}C_{ik}+\sum_{j=1}^{p}\beta_{j}X_{ij}+\epsilon_{i},

where \alpha_{0} is the intercept, \gamma_{k}'s and \beta_{j}'s are the regression coefficients corresponding to effects of clinical factors and genetic variants, respectively.

When penalty="elastic net" (default), the elastic net penalty is adopted. If penalty="lasso", the lasso penalty is used.

When sparse=TRUE (default), spike–and–slab priors are imposed to identify important main and interaction effects. If sparse=FALSE, Laplacian shrinkage will be used.

When robust=TRUE (default), the distribution of \epsilon_{i} is defined as a Laplace distribution with density f(\epsilon_{i}|\nu) = \frac{\nu}{2}\exp\left\{-\nu |\epsilon_{i}|\right\} , (i=1,\dots,n), which leads to a Bayesian formulation of LAD regression. If robust=FALSE, \epsilon_{i} follows a normal distribution.

Both X and clin will be standardized before the generation of interaction terms to avoid the multicollinearity between main effects and interaction terms.

Please check the references for more details about the prior distributions.

Value

an object of class ‘Bayenet’ is returned, which is a list with component:

posterior

the posterior samples of coefficients from the MCMC.

coefficient

the estimated value of coefficients.

burn.in

the total number of burn-ins.

iterations

the total number of iterations.

design

the design matrix of all effects.

References

Lu, X. and Wu, C. (2023). Bayesian quantile elastic net with spike-and-slab priors.

See Also

Selection

Examples

data(dat)

max.steps=5000
fit= Bayenet(X, Y, clin, max.steps, penalty="lasso")

## coefficients of parameters
fit$coefficient

## Estimated values of main G effects 
fit$coefficient$G

## Estimated values of clincal effects 
fit$coefficient$clin



[Package Bayenet version 0.2 Index]