R: Generate Information on the Next Interval for lambda
LASSO.exact
R Documentation
Generate Information on the Next Interval for λ
Description
LASSO.exact() generates the next value of λ_k and the associated selection indicator vector.
Usage
LASSO.exact(lambda, tau, X, y)
Arguments
lambda
a numerical value for lambda. It does not need to be one of the λ_ks.
tau
a vector of length p. Its elements are equal to 1, -1, or 0. This is the selection indicator vector.
X
an n\times p design matrix for the predictors.
y
a vector of the response values.
Details
This function computes the next λ_k that λ_k<λ. Although it is a stand-alone function, it is meant to be called by exact.path(). exact.path() automatically finds recursively the λ_ks and sets up the correct values for tau for each λ_k.
It is not necessary to standardize the columns of X and the response vector y. Such standardization is conducted anyway in this function.
Value
Given the value λ in [λ_k, λ_{k-1}) and τ(λ), this function returns a data frame with the following variables:
beta
a vector of length p. This is the vector of regression coefficients of the predictors evaluated at λ_k. Note that for active predictors, their coefficients are non-zero; for inactive predictors their coefficients are equal to 0.
S
a vector of length p. This is the vector of scores of the predictors evaluated at λ_k. Note that for active predictors, the absolute values of their scores should be equal to λ; for inactive predictors the absolute value of their scores are ≤q λ.
breaks
a vector of length p. This is the vector of candidate λ_ks provided by each predictor. For active predictors, this is the value at which its regression coefficient is equal to 0. For inactive predictors, this is the value at which the absolute value of its score is equal to λ. The largest value of this vector that is less than λ is chosen to be λ_k.
tau
a vector of length p. This is the vector of selection indicators predicted for λ_k^-.
change
a vector of length p. This is the vector of predicted status changes at λ_k^-: a predictor becomes active ("+"), inactive ("-"), or remains unchanged ("|").
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang K. (2013) Exact LASSO linear regression. Submitted.
See Also
exact.path automatically generates the whole solution paths.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(ExactPath)
Loading required package: ncvreg
Loading required package: lars
Loaded lars 1.2
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ExactPath/LASSO.exact.Rd_%03d_medium.png", width=480, height=480)
> ### Name: LASSO.exact
> ### Title: Generate Information on the Next Interval for lambda
> ### Aliases: LASSO.exact
>
> ### ** Examples
>
> library(lars)
> data(diabetes)
> LASSO.exact(0.05, c(0,-1,1,1,0,0,-1,0,1,1), diabetes$x, diabetes$y)
beta score breaks tau change
age 0.000000000 0.002026865 0.008269386 0 |
sex -0.069167263 -0.042598653 0.079582642 -1 |
bmi 0.316280991 0.042598653 9.047830952 1 |
map 0.155981676 0.042598653 0.210846751 1 |
tc 0.000000000 -0.042598653 0.042598653 -1 +
ldl 0.000000000 -0.042544022 0.042559075 0 |
hdl -0.121093961 -0.042598653 0.133725704 -1 |
tch 0.000000000 0.017165205 0.011499160 0 |
ltg 0.279435352 0.042598653 3.252298089 1 |
glu 0.007460471 0.042598653 0.054839408 1 |
>
>
>
>
>
> dev.off()
null device
1
>