Description Usage Arguments Details Value Author(s) References See Also Examples
LASSO.exact()
generates the next value of λ_k and the associated selection indicator vector.
1 | LASSO.exact(lambda, tau, X, y)
|
lambda |
a numerical value for |
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. |
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.
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 ( |
Kai Wang <kai-wang@uiowa.edu>
Wang K. (2013) Exact LASSO linear regression. Submitted.
exact.path
automatically generates the whole solution paths.
1 2 3 | library(lars)
data(diabetes)
LASSO.exact(0.05, c(0,-1,1,1,0,0,-1,0,1,1), diabetes$x, diabetes$y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.