Learn R Programming

lol (version 1.20.0)

getLambdaNcoef: get the lambda value that yield certain number of non-zero coefficients

Description

get the lambda value that yield certain number of non-zero coefficients

Usage

getLambdaNcoef(y, x, lambda1, nCoef, track=FALSE, model='linear', standardize=FALSE)

Arguments

y
A vector of expressions
x
a matrix of CN variables
lambda1
minimum lambda to use
nCoef
the number of coefficients to get
track
logical value for tracking the progress
model
which model to use, default to 'linear'
standardize
standardize the data or not

Value

lambda
The lambda value that gives approximate same number of non-zero coefficients as required

See Also

lasso

Examples

Run this code
data(chin07)
data <- list(y=chin07$ge[1,], x=t(chin07$cn))
getLambdaNcoef(data$y, data$x, lambda1=.1, nCoef=10, track=TRUE)

Run the code above in your browser using DataLab