Title: | Sure Independence Screening |
---|---|
Description: | Variable selection techniques are essential tools for model selection and estimation in high-dimensional statistical models. Through this publicly available package, we provide a unified environment to carry out variable selection using iterative sure independence screening (SIS) (Fan and Lv (2008)<doi:10.1111/j.1467-9868.2008.00674.x>) and all of its variants in generalized linear models (Fan and Song (2009)<doi:10.1214/10-AOS798>) and the Cox proportional hazards model (Fan, Feng and Wu (2010)<doi:10.1214/10-IMSCOLL606>). |
Authors: | Yang Feng [aut, cre], Jianqing Fan [aut], Diego Franco Saldana [aut], Yichao Wu [aut], Richard Samworth [aut] |
Maintainer: | Yang Feng <[email protected]> |
License: | GPL-2 |
Version: | 0.8-8 |
Built: | 2024-11-17 06:37:00 UTC |
Source: | CRAN |
Gene expression testing data of 7129 genes from 34 patients with acute leukemias (20 in class Acute Lymphoblastic Leukemia and 14 in class Acute Myeloid Leukemia) from the microarray study of Golub et al. (1999).
data(leukemia.test)
data(leukemia.test)
A data frame with 34 observations on 7129 variables.
http://wwwprod.broadinstitute.org/cgi-bin/cancer/datasets.cgi
Golub et al. (1999) Molecular Classification of Cancer: Class Discovery and Class Prediction by Gene Expression Monitoring. Science, 286, 531-537.
Gene expression training data of 7129 genes from 38 patients with acute leukemias (27 in class Acute Lymphoblastic Leukemia and 11 in class Acute Myeloid Leukemia) from the microarray study of Golub et al. (1999).
data(leukemia.train)
data(leukemia.train)
A data frame with 38 observations on 7129 variables.
http://wwwprod.broadinstitute.org/cgi-bin/cancer/datasets.cgi
Golub et al. (1999) Molecular Classification of Cancer: Class Discovery and Class Prediction by Gene Expression Monitoring. Science, 286, 531-537.
Similar to the usual predict methods, this function returns predictions from
a fitted 'SIS'
object.
## S3 method for class 'SIS' predict( object, newx, lambda = object$lambda, which = NULL, type = c("response", "link", "class"), ... )
## S3 method for class 'SIS' predict( object, newx, lambda = object$lambda, which = NULL, type = c("response", "link", "class"), ... )
object |
Fitted |
newx |
Matrix of new values for |
lambda |
Penalty parameter |
which |
Indices of the penalty parameter |
type |
Type of prediction required. Type |
... |
Not used. Other arguments to predict. |
The object returned depends on type.
Jianqing Fan, Yang Feng, Diego Franco Saldana, Richard Samworth, and Yichao Wu
Diego Franco Saldana and Yang Feng (2018) SIS: An R package for Sure Independence Screening in Ultrahigh Dimensional Statistical Models, Journal of Statistical Software, 83, 2, 1-25.
Jianqing Fan and Jinchi Lv (2008) Sure Independence Screening for Ultrahigh Dimensional Feature Space (with discussion). Journal of Royal Statistical Society B, 70, 849-911.
Jianqing Fan and Rui Song (2010) Sure Independence Screening in Generalized Linear Models with NP-Dimensionality. The Annals of Statistics, 38, 3567-3604.
Jianqing Fan, Richard Samworth, and Yichao Wu (2009) Ultrahigh Dimensional Feature Selection: Beyond the Linear Model. Journal of Machine Learning Research, 10, 2013-2038.
Jianqing Fan, Yang Feng, and Yichao Wu (2010) High-dimensional Variable Selection for Cox Proportional Hazards Model. IMS Collections, 6, 70-86.
Jianqing Fan, Yang Feng, and Rui Song (2011) Nonparametric Independence Screening in Sparse Ultrahigh Dimensional Additive Models. Journal of the American Statistical Association, 106, 544-557.
Diego Franco Saldana and Yang Feng (2014) SIS: An R package for Sure Independence Screening in Ultrahigh Dimensional Statistical Models, Journal of Statistical Software.
set.seed(0) n = 400; p = 50; rho = 0.5 corrmat = diag(rep(1-rho, p)) + matrix(rho, p, p) corrmat[,4] = sqrt(rho) corrmat[4, ] = sqrt(rho) corrmat[4,4] = 1 corrmat[,5] = 0 corrmat[5, ] = 0 corrmat[5,5] = 1 cholmat = chol(corrmat) x = matrix(rnorm(n*p, mean=0, sd=1), n, p) x = x%*%cholmat testX = matrix(rnorm(10*p, mean=0, sd=1), nrow=10, ncol=p) # gaussian response set.seed(1) b = c(4,4,4,-6*sqrt(2),4/3) y=x[, 1:5]%*%b + rnorm(n) model1=SIS(x, y, family='gaussian', tune='bic', varISIS='aggr', seed=11) predict(model1, testX, type='response') predict(model1, testX, which=1:10, type='response') ## Not run: # binary response set.seed(2) feta = x[, 1:5]%*%b; fprob = exp(feta)/(1+exp(feta)) y = rbinom(n, 1, fprob) model2=SIS(x, y, family='binomial', tune='bic', varISIS='aggr', seed=21) predict(model2, testX, type='response') predict(model2, testX, type='link') predict(model2, testX, type='class') predict(model2, testX, which=1:10, type='response') predict(model2, testX, which=1:10, type='link') predict(model2, testX, which=1:10, type='class') # poisson response set.seed(3) b = c(0.6,0.6,0.6,-0.9*sqrt(2)) myrates = exp(x[, 1:4]%*%b) y = rpois(n, myrates) model3=SIS(x, y, family='poisson', penalty = 'lasso',tune='bic', varISIS='aggr', seed=31) predict(model3, testX, type='response') predict(model3, testX, type='link') ## End(Not run)
set.seed(0) n = 400; p = 50; rho = 0.5 corrmat = diag(rep(1-rho, p)) + matrix(rho, p, p) corrmat[,4] = sqrt(rho) corrmat[4, ] = sqrt(rho) corrmat[4,4] = 1 corrmat[,5] = 0 corrmat[5, ] = 0 corrmat[5,5] = 1 cholmat = chol(corrmat) x = matrix(rnorm(n*p, mean=0, sd=1), n, p) x = x%*%cholmat testX = matrix(rnorm(10*p, mean=0, sd=1), nrow=10, ncol=p) # gaussian response set.seed(1) b = c(4,4,4,-6*sqrt(2),4/3) y=x[, 1:5]%*%b + rnorm(n) model1=SIS(x, y, family='gaussian', tune='bic', varISIS='aggr', seed=11) predict(model1, testX, type='response') predict(model1, testX, which=1:10, type='response') ## Not run: # binary response set.seed(2) feta = x[, 1:5]%*%b; fprob = exp(feta)/(1+exp(feta)) y = rbinom(n, 1, fprob) model2=SIS(x, y, family='binomial', tune='bic', varISIS='aggr', seed=21) predict(model2, testX, type='response') predict(model2, testX, type='link') predict(model2, testX, type='class') predict(model2, testX, which=1:10, type='response') predict(model2, testX, which=1:10, type='link') predict(model2, testX, which=1:10, type='class') # poisson response set.seed(3) b = c(0.6,0.6,0.6,-0.9*sqrt(2)) myrates = exp(x[, 1:4]%*%b) y = rpois(n, myrates) model3=SIS(x, y, family='poisson', penalty = 'lasso',tune='bic', varISIS='aggr', seed=31) predict(model3, testX, type='response') predict(model3, testX, type='link') ## End(Not run)
Gene expression testing data of 12600 genes from 25 patients with prostate tumors and 9 normal specimens from the microarray study of Singh et al. (2002).
data(prostate.test)
data(prostate.test)
A data frame with 34 observations on 12600 variables.
http://wwwprod.broadinstitute.org/cgi-bin/cancer/datasets.cgi
Singh et al. (2002) Gene Expression Correlates of Clinical Prostate Cancer Behavior. Cancer Cell, 1, 203-209.
Gene expression training data of 12600 genes from 52 patients with prostate tumors and 50 normal specimens from the microarray study of Singh et al. (2002).
data(prostate.train)
data(prostate.train)
A data frame with 102 observations on 12600 variables.
http://wwwprod.broadinstitute.org/cgi-bin/cancer/datasets.cgi
Singh et al. (2002) Gene Expression Correlates of Clinical Prostate Cancer Behavior. Cancer Cell, 1, 203-209.
This function first implements the Iterative Sure Independence Screening for different variants of (I)SIS, and then fits the final regression model using the R packages ncvreg and glmnet for the SCAD/MCP/LASSO regularized loglikelihood for the variables picked by (I)SIS.
SIS( x, y, family = c("gaussian", "binomial", "poisson", "cox"), penalty = c("SCAD", "MCP", "lasso"), concavity.parameter = switch(penalty, SCAD = 3.7, 3), tune = c("bic", "ebic", "aic", "cv"), nfolds = 10, type.measure = c("deviance", "class", "auc", "mse", "mae"), gamma.ebic = 1, nsis = NULL, iter = TRUE, iter.max = ifelse(greedy == FALSE, 10, floor(nrow(x)/log(nrow(x)))), varISIS = c("vanilla", "aggr", "cons"), perm = FALSE, q = 1, greedy = FALSE, greedy.size = 1, seed = NULL, standardize = TRUE )
SIS( x, y, family = c("gaussian", "binomial", "poisson", "cox"), penalty = c("SCAD", "MCP", "lasso"), concavity.parameter = switch(penalty, SCAD = 3.7, 3), tune = c("bic", "ebic", "aic", "cv"), nfolds = 10, type.measure = c("deviance", "class", "auc", "mse", "mae"), gamma.ebic = 1, nsis = NULL, iter = TRUE, iter.max = ifelse(greedy == FALSE, 10, floor(nrow(x)/log(nrow(x)))), varISIS = c("vanilla", "aggr", "cons"), perm = FALSE, q = 1, greedy = FALSE, greedy.size = 1, seed = NULL, standardize = TRUE )
x |
The design matrix, of dimensions n * p, without an intercept. Each
row is an observation vector. |
y |
The response vector of dimension n * 1. Quantitative for
|
family |
Response type (see above). |
penalty |
The penalty to be applied in the regularized likelihood subproblems. 'SCAD' (the default), 'MCP', or 'lasso' are provided. |
concavity.parameter |
The tuning parameter used to adjust the concavity of the SCAD/MCP penalty. Default is 3.7 for SCAD and 3 for MCP. |
tune |
Method for tuning the regularization parameter of the penalized
likelihood subproblems and of the final model selected by (I)SIS. Options
include |
nfolds |
Number of folds used in cross-validation. The default is 10. |
type.measure |
Loss to use for cross-validation. Currently five
options, not all available for all models. The default is
|
gamma.ebic |
Specifies the parameter in the Extended BIC criterion
penalizing the size of the corresponding model space. The default is
|
nsis |
Number of pedictors recuited by (I)SIS. |
iter |
Specifies whether to perform iterative SIS. The default is
|
iter.max |
Maximum number of iterations for (I)SIS and its variants. |
varISIS |
Specifies whether to perform any of the two ISIS variants
based on randomly splitting the sample into two groups. The variant
|
perm |
Specifies whether to impose a data-driven threshold in the size
of the active sets calculated during the ISIS procedures. The threshold is
calculated by first decoupling the predictors |
q |
Quantile for calculating the data-driven threshold in the
permutation-based ISIS. The default is |
greedy |
Specifies whether to run the greedy modification of the
permutation-based ISIS. The default is |
greedy.size |
Maximum size of the active sets in the greedy
modification of the permutation-based ISIS. The default is
|
seed |
Random seed used for sample splitting, random permutation, and cross-validation sampling of training and test sets. |
standardize |
Logical flag for x variable standardization, prior to
performing (iterative) variable screening. The resulting coefficients are
always returned on the original scale. Default is |
Returns an object with
sis.ix0 |
The vector of indices selected by only SIS. |
ix |
The vector of indices selected by (I)SIS with regularization step. |
coef.est |
The vector of coefficients of the final model selected by (I)SIS. |
fit |
A fitted object of type |
path.index |
The index along the solution path of
|
Jianqing Fan, Yang Feng, Diego Franco Saldana, Richard Samworth, and Yichao Wu
Diego Franco Saldana and Yang Feng (2018) SIS: An R package for Sure Independence Screening in Ultrahigh Dimensional Statistical Models, Journal of Statistical Software, 83, 2, 1-25.
Jianqing Fan and Jinchi Lv (2008) Sure Independence Screening for Ultrahigh Dimensional Feature Space (with discussion). Journal of Royal Statistical Society B, 70, 849-911.
Jianqing Fan and Rui Song (2010) Sure Independence Screening in Generalized Linear Models with NP-Dimensionality. The Annals of Statistics, 38, 3567-3604.
Jianqing Fan, Richard Samworth, and Yichao Wu (2009) Ultrahigh Dimensional Feature Selection: Beyond the Linear Model. Journal of Machine Learning Research, 10, 2013-2038.
Jianqing Fan, Yang Feng, and Yichao Wu (2010) High-dimensional Variable Selection for Cox Proportional Hazards Model. IMS Collections, 6, 70-86.
Jianqing Fan, Yang Feng, and Rui Song (2011) Nonparametric Independence Screening in Sparse Ultrahigh Dimensional Additive Models. Journal of the American Statistical Association, 106, 544-557.
Jiahua Chen and Zehua Chen (2008) Extended Bayesian Information Criteria for Model Selection with Large Model Spaces. Biometrika, 95, 759-771.
set.seed(0) n = 400; p = 50; rho = 0.5 corrmat = diag(rep(1-rho, p)) + matrix(rho, p, p) corrmat[,4] = sqrt(rho) corrmat[4, ] = sqrt(rho) corrmat[4,4] = 1 corrmat[,5] = 0 corrmat[5, ] = 0 corrmat[5,5] = 1 cholmat = chol(corrmat) x = matrix(rnorm(n*p, mean=0, sd=1), n, p) x = x%*%cholmat # gaussian response set.seed(1) b = c(4,4,4,-6*sqrt(2),4/3) y=x[, 1:5]%*%b + rnorm(n) # SIS without regularization model10 = SIS(x, y, family='gaussian', iter = FALSE) model10$sis.ix0 # ISIS with regularization model11=SIS(x, y, family='gaussian', tune='bic') model12=SIS(x, y, family='gaussian', tune='bic', varISIS='aggr', seed=11) model11$ix model12$ix ## Not run: # binary response set.seed(2) feta = x[, 1:5]%*%b; fprob = exp(feta)/(1+exp(feta)) y = rbinom(n, 1, fprob) model21=SIS(x, y, family='binomial', tune='bic') model22=SIS(x, y, family='binomial', tune='bic', varISIS='aggr', seed=21) model21$ix model22$ix # poisson response set.seed(3) b = c(0.6,0.6,0.6,-0.9*sqrt(2)) myrates = exp(x[, 1:4]%*%b) y = rpois(n, myrates) model31=SIS(x, y, family='poisson', penalty = 'lasso', tune='bic', perm=TRUE, q=0.9, greedy=TRUE, seed=31) model32=SIS(x, y, family='poisson', penalty = 'lasso', tune='bic', varISIS='aggr', perm=TRUE, q=0.9, seed=32) model31$ix model32$ix # Cox model set.seed(4) b = c(4,4,4,-6*sqrt(2),4/3) myrates = exp(x[, 1:5]%*%b) Sur = rexp(n,myrates); CT = rexp(n,0.1) Z = pmin(Sur,CT); ind = as.numeric(Sur<=CT) y = survival::Surv(Z,ind) model41=SIS(x, y, family='cox', penalty='lasso', tune='bic', varISIS='aggr', seed=41) model42=SIS(x, y, family='cox', penalty='lasso', tune='bic', varISIS='cons', seed=41) model41$ix model42$ix ## End(Not run)
set.seed(0) n = 400; p = 50; rho = 0.5 corrmat = diag(rep(1-rho, p)) + matrix(rho, p, p) corrmat[,4] = sqrt(rho) corrmat[4, ] = sqrt(rho) corrmat[4,4] = 1 corrmat[,5] = 0 corrmat[5, ] = 0 corrmat[5,5] = 1 cholmat = chol(corrmat) x = matrix(rnorm(n*p, mean=0, sd=1), n, p) x = x%*%cholmat # gaussian response set.seed(1) b = c(4,4,4,-6*sqrt(2),4/3) y=x[, 1:5]%*%b + rnorm(n) # SIS without regularization model10 = SIS(x, y, family='gaussian', iter = FALSE) model10$sis.ix0 # ISIS with regularization model11=SIS(x, y, family='gaussian', tune='bic') model12=SIS(x, y, family='gaussian', tune='bic', varISIS='aggr', seed=11) model11$ix model12$ix ## Not run: # binary response set.seed(2) feta = x[, 1:5]%*%b; fprob = exp(feta)/(1+exp(feta)) y = rbinom(n, 1, fprob) model21=SIS(x, y, family='binomial', tune='bic') model22=SIS(x, y, family='binomial', tune='bic', varISIS='aggr', seed=21) model21$ix model22$ix # poisson response set.seed(3) b = c(0.6,0.6,0.6,-0.9*sqrt(2)) myrates = exp(x[, 1:4]%*%b) y = rpois(n, myrates) model31=SIS(x, y, family='poisson', penalty = 'lasso', tune='bic', perm=TRUE, q=0.9, greedy=TRUE, seed=31) model32=SIS(x, y, family='poisson', penalty = 'lasso', tune='bic', varISIS='aggr', perm=TRUE, q=0.9, seed=32) model31$ix model32$ix # Cox model set.seed(4) b = c(4,4,4,-6*sqrt(2),4/3) myrates = exp(x[, 1:5]%*%b) Sur = rexp(n,myrates); CT = rexp(n,0.1) Z = pmin(Sur,CT); ind = as.numeric(Sur<=CT) y = survival::Surv(Z,ind) model41=SIS(x, y, family='cox', penalty='lasso', tune='bic', varISIS='aggr', seed=41) model42=SIS(x, y, family='cox', penalty='lasso', tune='bic', varISIS='cons', seed=41) model41$ix model42$ix ## End(Not run)
Standardizes the columns of a high-dimensional design matrix to mean zero and unit Euclidean norm.
standardize(X)
standardize(X)
X |
A design matrix to be standardized. |
Performs a location and scale transform to the columns of the original
design matrix, so that the resulting design matrix with -dimensional
observations
of the form
satisfies
and
for
.
A design matrix with standardized predictors or columns.
Jianqing Fan, Yang Feng, Diego Franco Saldana, Richard Samworth, and Yichao Wu
Diego Franco Saldana and Yang Feng (2018) SIS: An R package for Sure Independence Screening in Ultrahigh Dimensional Statistical Models, Journal of Statistical Software, 83, 2, 1-25.
set.seed(0) n = 400; p = 50; rho = 0.5 corrmat = diag(rep(1-rho, p)) + matrix(rho, p, p) corrmat[,4] = sqrt(rho) corrmat[4, ] = sqrt(rho) corrmat[4,4] = 1 corrmat[,5] = 0 corrmat[5, ] = 0 corrmat[5,5] = 1 cholmat = chol(corrmat) x = matrix(rnorm(n*p, mean=15, sd=9), n, p) x = x%*%cholmat x.standard = standardize(x)
set.seed(0) n = 400; p = 50; rho = 0.5 corrmat = diag(rep(1-rho, p)) + matrix(rho, p, p) corrmat[,4] = sqrt(rho) corrmat[4, ] = sqrt(rho) corrmat[4,4] = 1 corrmat[,5] = 0 corrmat[5, ] = 0 corrmat[5,5] = 1 cholmat = chol(corrmat) x = matrix(rnorm(n*p, mean=15, sd=9), n, p) x = x%*%cholmat x.standard = standardize(x)
This function fits a generalized linear model or a Cox proportional hazards
model via penalized maximum likelihood, with available penalties as
indicated in the glmnet and ncvreg packages. Instead of
providing the whole regularization solution path, the function returns the
solution at a unique value of , the one optimizing the
criterion specified in
tune
.
tune.fit( x, y, family = c("gaussian", "binomial", "poisson", "cox"), penalty = c("SCAD", "MCP", "lasso"), concavity.parameter = switch(penalty, SCAD = 3.7, 3), tune = c("cv", "aic", "bic", "ebic"), nfolds = 10, type.measure = c("deviance", "class", "auc", "mse", "mae"), gamma.ebic = 1 )
tune.fit( x, y, family = c("gaussian", "binomial", "poisson", "cox"), penalty = c("SCAD", "MCP", "lasso"), concavity.parameter = switch(penalty, SCAD = 3.7, 3), tune = c("cv", "aic", "bic", "ebic"), nfolds = 10, type.measure = c("deviance", "class", "auc", "mse", "mae"), gamma.ebic = 1 )
x |
The design matrix, of dimensions n * p, without an intercept. Each row is an observation vector. |
y |
The response vector of dimension n * 1. Quantitative for
|
family |
Response type (see above). |
penalty |
The penalty to be applied in the regularized likelihood subproblems. 'SCAD' (the default), 'MCP', or 'lasso' are provided. |
concavity.parameter |
The tuning parameter used to adjust the concavity of the SCAD/MCP penalty. Default is 3.7 for SCAD and 3 for MCP. |
tune |
Method for selecting the regularization parameter along the
solution path of the penalized likelihood problem. Options to provide a
final model include |
nfolds |
Number of folds used in cross-validation. The default is 10. |
type.measure |
Loss to use for cross-validation. Currently five
options, not all available for all models. The default is
|
gamma.ebic |
Specifies the parameter in the Extended BIC criterion
penalizing the size of the corresponding model space. The default is
|
Returns an object with
ix |
The vector of indices of the
nonzero coefficients selected by the maximum penalized likelihood procedure
with |
a0 |
The intercept of the final model selected by |
beta |
The vector of coefficients of the final model selected by
|
fit |
The fitted penalized regression object. |
lambda |
The corresponding lambda in the final model. |
lambda.ind |
The index on the solution path for the final model. |
Jianqing Fan, Yang Feng, Diego Franco Saldana, Richard Samworth, and Yichao Wu
Jerome Friedman and Trevor Hastie and Rob Tibshirani (2010) Regularization Paths for Generalized Linear Models Via Coordinate Descent. Journal of Statistical Software, 33(1), 1-22.
Noah Simon and Jerome Friedman and Trevor Hastie and Rob Tibshirani (2011) Regularization Paths for Cox's Proportional Hazards Model Via Coordinate Descent. Journal of Statistical Software, 39(5), 1-13.
Patrick Breheny and Jian Huang (2011) Coordiante Descent Algorithms for Nonconvex Penalized Regression, with Applications to Biological Feature Selection. The Annals of Applied Statistics, 5, 232-253.
Hirotogu Akaike (1973) Information Theory and an Extension of the Maximum Likelihood Principle. In Proceedings of the 2nd International Symposium on Information Theory, BN Petrov and F Csaki (eds.), 267-281.
Gideon Schwarz (1978) Estimating the Dimension of a Model. The Annals of Statistics, 6, 461-464.
Jiahua Chen and Zehua Chen (2008) Extended Bayesian Information Criteria for Model Selection with Large Model Spaces. Biometrika, 95, 759-771.
set.seed(0) data('leukemia.train', package = 'SIS') y.train = leukemia.train[,dim(leukemia.train)[2]] x.train = as.matrix(leukemia.train[,-dim(leukemia.train)[2]]) x.train = standardize(x.train) model = tune.fit(x.train[,1:3500], y.train, family='binomial', tune='bic') model$ix model$a0 model$beta
set.seed(0) data('leukemia.train', package = 'SIS') y.train = leukemia.train[,dim(leukemia.train)[2]] x.train = as.matrix(leukemia.train[,-dim(leukemia.train)[2]]) x.train = standardize(x.train) model = tune.fit(x.train[,1:3500], y.train, family='binomial', tune='bic') model$ix model$a0 model$beta