bootstrap.path {glmpath} | R Documentation |
This function generates a set of bootstrap coefficients for either
glmpath
or coxpath.
For each bootstrap run, the
regularization parameter may be determined based on either aic
or bic.
bootstrap.path(x, y, data, B, index=NULL, path=c("glmpath","coxpath"), method=c("aic","bic"), trace=FALSE, ...)
x |
matrix of features |
y |
response |
data |
a list of data components. If path=glmpath, data
consists of x: a matrix of features and y:
response. data is not needed if x and y are
input separately. If path=coxpath, data must be
provided, including x: a matrix of features, time: the
survival time, and status: censor status with 1 if died and 0
if censored.
|
B |
number of bootstrap runs |
index |
matrix (B rows, ncol(x) columns) of bootstrap sample
indices. Each row is a vector of indices for a bootstrap run. If
index=NULL, the indices are randomly chosen.
|
path |
Bootstrap coefficients for either glmpath or coxpath
are computed. Default is path=glmpath.
|
method |
For each bootstrap run, the regularization parameter is determined
based on either aic or bic. Default is aic.
|
trace |
If TRUE, the number of bootstrap runs is printed out.
|
... |
other options for glmpath or coxpath
|
Fitting glmpath
or coxpath
gives a series of solution
sets with a varying size of the active set. Once we select an
appropriate value of the regularization parameter, and thus a set of
coefficients, we may then validate the chosen coefficients through
bootstrap analysis. plot.bootstrap
summarizes the bootstrap
results by generating the histograms or the pair scatter plots of the
bootstrap coefficients.
bootstrap.path
returns a bootpath
object, which is a
matrix (B
by ncol(x)
) of bootstrap
coefficients. Coefficients computed from the whole data are stored as
an attribute coefficients.
Mee Young Park and Trevor Hastie
Bradley Efron and Robert Tibshirani (1993) An Introduction to the Bootstrap CHAPMAN & HALL/CRC, Boca Raton.
Mee Young Park and Trevor Hastie (2007) L1 regularization path algorithm for generalized linear models. J. R. Statist. Soc. B, 69, 659-677.
coxpath, glmpath, plot.bootstrap
data(heart.data) attach(heart.data) bootstrap.a <- bootstrap.path(x, y, B=100, method="bic") detach(heart.data) data(lung.data) attach(lung.data) bootstrap.b <- bootstrap.path(data=lung.data, B=100, path="coxpath") detach(lung.data)