lasso_cv_search: Search for optimal lambda via cross-validation

lasso_cv_searchR Documentation

Description

Search for optimal lambda via cross-validation

Usage

lasso_cv_search(
  x,
  y,
  tau = 0.5,
  weights = NULL,
  method = "two_pass",
  intercept = TRUE,
  nfolds = 10,
  foldid = NULL,
  nlambda = 100,
  eps = 1e-04,
  init.lambda = 2,
  parallel = T,
  coef.cutoff = 1e-05,
  thresh = 0.01,
  ...
)

Arguments

x

design matrix for regression

y

outcome variable for regression

tau

target quantile

weights

optional weights for regression

method

method to be used for penalized quantile regression (usually one of "sfn" or "br")

intercept

Whether to model the intercept or not

nfolds

number of folds to use for crossvalidation

foldid

optional pre-specified fold identifier (for example, if you want the folds to satisfy underlying data groupings)

nlambda

number of lambdas to search over

eps

smallest lambda used in search

init.lambda

initial lambda for search

parallel

whether to run cv scoring in parallel or not

coef.cutoff

what cutoff to use for "0" coefficients

thresh

threshhold for what counts as a "sparse enough" solution for the top of the grid

...

other parameters to pass on to fitting method

Details

Searches for a range of lambdas by first expanding the max lambda if necessary, then finding the smallest lambda that sets all coefficients to zero. Then it computes kfold CV scores along a grid of lambdas, returning the scores and the smallest lambda.


be-green/quantspace documentation built on March 20, 2024, 5:30 p.m.