Learn R Programming

bst (version 0.3-24)

bst.sel: Function to select number of predictors

Description

Function to determine the first q predictors in the boosting path, or perform (10-fold) cross-validation and determine the optimal set of parameters

Usage

bst.sel(x, y, q, type=c("firstq", "cv"), ...)

Value

Vector of selected predictors.

Arguments

x

Design matrix (without intercept).

y

Continuous response vector for linear regression

q

Maximum number of predictors that should be selected if type="firstq".

type

if type="firstq", return the first q predictors in the boosting path. if type="cv", perform (10-fold) cross-validation and determine the optimal set of parameters

...

Further arguments to be passed to bst, cv.bst.

Author

Zhu Wang

Details

Function to determine the first q predictors in the boosting path, or perform (10-fold) cross-validation and determine the optimal set of parameters. This may be used for p-value calculation. See below.

Examples

Run this code
if (FALSE) {
x <- matrix(rnorm(100*100), nrow = 100, ncol = 100)
y <- x[,1] * 2 + x[,2] * 2.5 + rnorm(100)
sel <- bst.sel(x, y, q=10)
library("hdi")
fit.multi <- hdi(x, y, method = "multi.split",
model.selector =bst.sel,
args.model.selector=list(type="firstq", q=10))
fit.multi
fit.multi$pval[1:10] ## the first 10 p-values
fit.multi <- hdi(x, y, method = "multi.split",
model.selector =bst.sel,
args.model.selector=list(type="cv"))
fit.multi
fit.multi$pval[1:10] ## the first 10 p-values
}

Run the code above in your browser using DataLab