tune the lasso parameter in the regression model : \(Y= X \beta + \sigma N(0,1)\) using the lasso or the gauss-lasso method
tuneLasso(Y, X, normalize = TRUE, method = c("lasso", "Glasso"),
dmax = NULL, Vfold = TRUE, V = 10, LINselect = TRUE, a = 0.5,
K = 1.1, verbose = TRUE, max.steps = NULL)
A list with one or two components according to
method
.
lasso
if method
contains "lasso" is a list with one or two components
according to Vfold
and LINselect
.
Ls
if LINselect
=TRUE. A list with components
support
: vector of integers. Estimated support of the
parameter vector \(\beta\).
coef
: vector whose first component is the estimated
intercept.
The other components are the estimated non zero
coefficients.
fitted
: vector with length n. Fitted value of
the response.
crit
: vector containing the values of the criteria for
each value of lambda
.
lambda
: vector containing the values of the tuning
parameter of the lasso algorithm.
CV
if Vfold
=TRUE. A list with components
support
: vector of integers. Estimated support of the
parameter vector \(\beta\).
coef
: vector whose first component is the estimated
intercept.
The other components are the estimated non zero
coefficients.
fitted
: vector with length n. Fitted value of
the response.
crit
: vector containing the values of the criteria for
each value of lambda
.
crit.err
: vector containing the estimated
standard-error of the criteria.
lambda
: vector containing the values of the tuning
parameter of the lasso algorithm.
Glasso
if method
contains "Glasso". The same as lasso
.
vector with n components : response variable.
matrix with n rows and p columns : covariates.
logical : corresponds to the input normalize
of the functions enet
and cv.enet
.
If TRUE the variates X
are
normalized.
vector of characters whose components are subset of (“lasso”, “Glasso”)
integer : maximum number of variables in the lasso
estimator. dmax
\(\le\) D where
D = min (3*p/4 , n-5) if p\( \ge \)n
D= min(p,n-5) if
p < n.
Default : dmax
= D.
logical : if TRUE the tuning is done by Vfold-CV
integer. Gives the value of V in the Vfold-CV procedure
logical : if TRUE the tuning is done by LINselect
scalar : value of the parameter \(\alpha\) in the LINselect criteria
scalar : value of the parameter \(K\) in the LINselect criteria
logical : if TRUE a trace of the current process is displayed in real time.
integer : maximum number of steps in the lasso
procedure.
Corresponds to the input max.steps
of the function
enet
.
Default :
max.steps
= 2*min(p,n)
Yannick Baraud, Christophe Giraud, Sylvie Huet
See Baraud et al. 2010
http://hal.archives-ouvertes.fr/hal-00502156/fr/
Giraud et al., 2013,
https://projecteuclid.org/DPubS?service=UI&version=1.0&verb=Display&handle=euclid.ss/1356098553
#source("charge.R")
library("LINselect")
# simulate data with
if (FALSE) ex <- simulData(p=100,n=100,r=0.8,rSN=5)
if (FALSE) ex1.tuneLasso <- tuneLasso(ex$Y,ex$X)
if (FALSE) data(diabetes)
if (FALSE) attach(diabetes)
if (FALSE) ex.diab <- tuneLasso(y,x2)
if (FALSE) detach(diabetes)
Run the code above in your browser using DataLab