Learn R Programming

ExactPath (version 1.0)

exact.path: Generate Exact Solution Path

Description

exact.path generates the whole solution paths.

Usage

exact.path(X, y, max.var=20, verbose=FALSE)

Arguments

X
an $n\times p$ design matrix for the predictors.
y
a vector of the response values.
max.var
a numerical value (default value: 20) that gives the maximum number of steps. Extra 4 steps are allowed in case the same set of predictors enter or exit the set of active predictors more than once. This value contributes to the determination of how many $\lambda_k$s are to be found.
verbose
If TRUE, the value of $\lambda_k$ and the associated information will be printed at every step a new $\lambda_k$ is found. The default is FALSE.

Value

A list object of class "path". This list contains the following components:
breaks
a length $K$ vector of $\lambda_k$s
tau
a $p\times K$ matrix of selection indicators.
beta
a $p\times K$ matrix of regression coefficients. See also LASSO.exact.
score
a $p\times K$ matrix of scores. See also LASSO.exact.

Details

Starting with a large value, this function finds recursively $\lambda_1$, $\lambda_2$, $\ldots$ until the desired number of steps is achieved. At each step, inactive predictors become active, active predictors become inactive, or both. The selection indicator is automatically determined. The backend engine is LASSO.exact.

It is not necessary to standardize the columns of X and the response vector y. Such standardization is conducted anyway in this function.

References

Wang K. (2013) Exact LASSO linear regression. Submitted.

See Also

LASSO.exact is the function for generating $\lambda_k$ at each step.

Examples

Run this code
library(ncvreg)
data(prostate)
exact.path(as.matrix(prostate[,-9]), prostate$lpsa, verbose=TRUE)

library(ncvreg)
data(heart)
exact.path(as.matrix(heart[,-1]), heart$sbp)

library(lars)
data(diabetes)
exact.path(diabetes$x, diabetes$y, verbose=TRUE)

Run the code above in your browser using DataLab