cv.gamma: Cross-Validation to choose the optimal gamma from a sequence...

Description Usage Arguments Value Examples

View source: R/FunctionsALasso.R

Description

Cross-Validation to choose the optimal gamma from a sequence of gamma values for a particular sequence of lambdas

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cv.gamma(
  X,
  Y,
  tuning_seq = NULL,
  len_tuning = 60,
  gamma_seq = NULL,
  n_gamma = 60,
  k = 5,
  id_fold = NULL,
  eps = 0.001
)

Arguments

X

n x p design matrix of inputs

Y

n x 1 vector of outputs

tuning_seq

(optional)sequence of tuning parameters

len_tuning

length of desired tuning parameter sequence

gamma_seq

(optional)sequence of gamma values(used in determining weights)

n_gamma

length of the desired sequence of gamma values

k

number of folds for k-fold cross-validation, default is 5

id_fold

(optional) vector of length n specifying the folds assignment (from 1 to max(folds_ids)), if supplied the value of k is ignored

eps

precision level for convergence assessment, default 0.001

Value

cv

a n_gamma x len_tuning matrix giving CV(lambda, gamma) for each pair of (lambda, gamma)

gamma_min

optimal gamma

lambda_min

selected lambda based on minimal rule

Examples

1
2
3
X <- matrix(rnorm(500), 50, 10)
Y <- rnorm(50)
fit_cv_gamma <- cv.gamma(X , Y)

Saptati-Datta/AdapLasso documentation built on Dec. 18, 2021, 12:57 p.m.