glmpath (version 0.98)

bootstrap.path: Generates a set of bootstrap coefficients for glmpath or coxpath

Description

This function generates a set of bootstrap coefficients for glmpath or coxpath. For each bootstrap run, the regularization parameter may be determined based on either aic or bic.

Usage

bootstrap.path(x, y, data, B, index = NULL,
                 path = c("glmpath", "coxpath"),
                 method = c("aic", "bic"), trace = FALSE, ...)

Arguments

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

Value

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.

Details

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.

References

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.

See Also

coxpath, glmpath, plot.bootstrap

Examples

Run this code
# NOT RUN {
data(heart.data)
attach(heart.data)
bootstrap.a <- bootstrap.path(x, y, B=5, method="bic")
detach(heart.data)
data(lung.data)
attach(lung.data)
bootstrap.b <- bootstrap.path(data=lung.data, B=5, path="coxpath")
detach(lung.data)
# }

Run the code above in your browser using DataLab