cv.adaptive_lasso: Adaptive lasso with cross-validation, using lasso(BIC) as...

View source: R/adaptive-lasso.R

cv.adaptive_lassoR Documentation

Adaptive lasso with cross-validation, using lasso(BIC) as initial estimator

Description

Using cv.glmnet() to carry out the adaptive lasso will result in an underestimation of error unless you also apply cross-validation to the initial estimator; this function provides a wrapper to do that.

Usage

cv.adaptive_lasso(X, y, nfolds = 10, seed)

Arguments

X

Design matrix, as in glmnet()

y

Response vector, as in glmnet()

nfolds

Number of cv folds (default: 10)

seed

For reproducibility with respect to the fold assignments

Examples

attachData(pollution)
cvfit <- cv.adaptive_lasso(X, y)
plot(cvfit)
summary(cvfit)


pbreheny/hdrm documentation built on May 24, 2024, 9:30 p.m.