cv.lasso: Cross-validation

Description Usage Arguments Value

View source: R/cv_lasso.R

Description

Cross-validation for lasso

Usage

1
2
cv.lasso(x, y, wt = NULL, ts = NULL, method = lasso_cd, k = 5,
  n_it = 10, df = NULL)

Arguments

x

predictors

y

response

wt

weights for the coefficients of weighted LASSO. Defaults to NULL

ts

stepsize for proximal gradient and sub-gradient method (use opt_ts() to generate stepsize). Defaults to NULL

method

lasso optimization function. Three different methods are available to use. method = c(lasso_cd, lasso_sg, lasso_pg). Defaults to lasso_cd

k

number of fold. Default value is 5.

n_it

number of iteration for lasso_cd method. Default value is 10.

df

Degree of freedom. Number of desired variables to be zero. Defaults to NULL

Value

The function returns the following list of outputs

model

The values of coefficients corresponding to each lambda

error

Mean-squared error of the cross-validated model corresponding to each lambda

coeff

The values of coefficients corresponding to minimum mean-squared error

index

Index of the minimum mean-squared error (for internal use)


tathagatabasu/bootlasso documentation built on Aug. 9, 2019, 1:07 a.m.