bamlasso | R Documentation |
Bauesian Spike-and-Slab Lasso Additive Model
bamlasso(
x,
y,
family = c("gaussian", "binomial", "poisson", "cox"),
offset = NULL,
epsilon = 1e-04,
maxit = 50,
init = NULL,
alpha = c(1, 0),
ss = c(0.04, 0.5),
b = 1,
group = NULL,
theta.weights = NULL,
inter.hierarchy = NULL,
inter.parents = NULL,
Warning = FALSE,
verbose = FALSE
)
x |
input matrix, of dimension nobs x nvars; each row is an observation vector. |
y |
response variable. Quantitative for family="gaussian", or family="poisson" (non-negative counts). For family="binomial", y should be either a factor with two levels, or a two-column matrix of counts or proportions (the second column is treated as the target class; for a factor, the last level in alphabetical order is the target class). For family="cox", y should be a two-column matrix with columns named 'time' and 'status'. The latter is a binary variable, with '1' indicating death, and '0' indicating right censored. The function Surv() in package survival produces such a matrix. |
family |
Response type (see above). |
offset |
A vector of length nobs that is included in the linear predictor. |
epsilon |
positive convergence tolerance e; the iterations converge when |dev - dev_old|/(|dev| + 0.1) < e. |
maxit |
integer giving the maximal number of EM iterations. |
init |
vector of initial values for all coefficients (not for intercept). If not given, it will be internally produced. |
alpha |
|
ss |
a vector of two positive scale values (ss[1] < ss[2]) for the spike-and-slab mixture prior, leading to different shrinkage on different predictors and allowing for incorporation of group information. |
b |
group-specific inclusion probabilities follow beta(1,b). The tuning parameter |
group |
a numeric vector, or an integer, or a list defining the groups of predictors. Only used for mde or mt priors. If group = NULL, all the predictors form a single group. If group = K, the predictors are evenly divided into groups each with K predictors. If group is a numberic vector, it defines groups as follows: Group 1: (group[1]+1):group[2], Group 2: (group[2]+1):group[3], Group 3: (group[3]+1):group[4], ..... If group is a list of variable names, group[[k]] includes variables in the k-th group. |
theta.weights |
Optional weights for the dispersion parameter. |
inter.hierarchy |
Optional specification for hierarchical interaction terms. |
inter.parents |
a numeric vector, or an integer, or a list defining the groups of predictors.
If |
Warning |
logical. If |
verbose |
logical. If |
This function returns all outputs from the function glmnet
, and some other values used in Bayesian hierarchical models.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.