cox_bvs {BVSNLP}R Documentation

Non-parallel version of Bayesian variable selector for survival data using nonlocal priors

Description

This function performs Bayesian variable selection for survival data in a non-parallel fashion. It runs modified S5 algorithm to search the model space but since this is only on one CPU, the number of visited models will not be large and therefore is NOT recommended for high dimensional datasets. This function is called by bvs function in a parllel fashion and therefore that function is recommended to be used.

Usage

cox_bvs(exmat, cur_cols, nf, tau, r, nlptype, a, b, d, L, J, temps)

Arguments

exmat

An extended matrix where the first two columns are survival times and status, respectively and the rest is the design matrix which is produced by PreProcess function.

cur_cols

A vector containing indices of the initial model for variable selector to start the S5 algorithm from. Note that the first nf indices are 1 to nf where nf is the number of fixed covariates that do not enter the selection procedure.

nf

The number of fixed covariates that do not enter the selection procedure.

tau

The paramter tau of the iMOM prior.

r

The paramter r of the iMOM prior.

nlptype

Determines the type of nonlocal prior that is used in the analyses. 0 is for piMOM and 1 is for pMOM.

a

The first parameter in beta distribution used as prior on model size. This parameter is equal to 1 when uinform-binomial prior is used.

b

The second paramter in beta distribution used as prior on model size. This parameter is equal to 1 when uinform-binomial prior is used.

d

This is the number of candidate covariates picked from top variables with highest utility function value and used in S5 algorithm.

L

Number of temperatures in S5 algorithm.

J

Number of iterations at each temperature in S5 algorithm.

temps

Vector of temperatuers used in S5 algorithm.

Value

It returns a list containing following objects:

max_model

A 1 by p binary vector showing the selected model with maximum probability. 1 means a specific variable is selected.

hash_key

A column vector indicating the generated key for each model that is used to track visited models and growing dictionary.

max_prob

The unnormalized probability of the model with highest posterior probability.

all_probs

A vector containing unnormalized probabilities of all visited models.

vis_covs_list

A list containing the covariates in each visited model in the stochastic search process.

Author(s)

Amir Nikooienejad

References

Nikooienejad, A., Wang, W., and Johnson, V. E. (2017). Bayesian Variable Selection in High Dimensional Survival Time Cancer Genomic Datasets using Nonlocal Priors. arXiv preprint, arXiv:1712.02964.

Shin, M., Bhattacharya, A., and Johnson, V. E. (2017). Scalable Bayesian variable selection using nonlocal prior densities in ultrahigh dimensional settings. Statistica Sinica.

Johnson, V. E., and Rossell, D. (2010). On the use of non-local prior densities in Bayesian hypothesis tests. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 72(2), 143-170.

See Also

bvs

Examples

### Initializing the parameters
n <- 100
p <- 40
set.seed(123)
Sigma <- diag(p)
full <- matrix(c(rep(0.5, p*p)), ncol=p)
Sigma <- full + 0.5*Sigma
cholS <- chol(Sigma)
Beta <- c(-1.8, 1.2, -1.7, 1.4, -1.4, 1.3)
X = matrix(rnorm(n*p), ncol=p)
X = X%*%cholS
X <- scale(X)
beta <- numeric(p)
beta[c(1:length(Beta))] <- Beta
XB <- X%*%beta
sur_times <- rexp(n,exp(XB))
cens_times <- rexp(n,0.2)
times <- pmin(sur_times,cens_times)
status <- as.numeric(sur_times <= cens_times)
exmat <- cbind(times,status,X)
L <- 10; J <- 10
d <- 2 * ceiling(log(p))
temps <- seq(3, 1, length.out = L)
tau <- 0.5; r <- 1; a <- 6; b <- p-a
nlptype <- 0 ### PiMOM nonlocal prior
cur_cols <- c(1,2,3) ### Starting model for the search algorithm
nf <- 0 ### No fixed columns

### Running the Function
coxout <- cox_bvs(exmat,cur_cols,nf,tau,r,nlptype,a,b,d,L,J,temps)

### The number of visited model for this specific run:
length(coxout$hash_key)


### The selected model:
which(coxout$max_model>0)

### The unnormalized probability of the selected model:
coxout$max_prob


[Package BVSNLP version 1.1.9 Index]