Learn R Programming

hdi (version 0.1-9)

stability: Function to perform stability selection

Description

Function to perform stability selection

Usage

stability(x, y, EV, threshold = 0.75, B = 100, fraction = 0.5,
          model.selector = lasso.firstq, args.model.selector = NULL,
          parallel = FALSE, ncores = getOption("mc.cores", 2L),
          verbose = FALSE)

Arguments

x

Design matrix (without intercept).

y

Response vector.

EV

Bound for expected number of false positives.

threshold

Threshold for selection frequency. Must be in (0.5, 1).

B

Number of sub-sample iterations.

fraction

Fraction of data used at each of the B sub-samples.

model.selector

Function to perform model selection. Default is lasso.firstq. User supplied function must have at least three arguments: x (the design matrix), y (the response vector) and q (the maximal model size). Return value is the index vector of selected columns. See lasso.firstq for an example. Additional arguments can be passed through args.model.selector.

args.model.selector

Named list of further arguments for function model.selector.

parallel

Should parallelization be used? (logical)

ncores

Number of cores used for parallelization.

verbose

Should information be printed out while computing (logical).

Value

selected

Vector of selected predictors.

freq

Vector of selection frequencies.

q

Size of fitted models in order to control error rate at desired level.

References

Meinshausen, N. and B<U+00FC>hlmann, P. (2010) Stability selection (with discussion). Journal of the Royal Statistical Society: Series B 72, 417--473.

B<U+00FC>hlmann, P., Kalisch, M. and Meier, L. (2014) High-dimensional statistics with a view towards applications in biology. Annual Review of Statistics and its Applications 1, 255--278

Examples

Run this code
# NOT RUN {
x <- matrix(rnorm(100 * 1000), nrow = 100, ncol = 1000)
y <- x[,1] * 2 + x[,2] * 2.5 + rnorm(100)
fit.stab <- stability(x, y, EV = 1)
fit.stab
fit.stab$freq[1:10] ## selection frequency of the first 10 predictors
# }

Run the code above in your browser using DataLab