Description Usage Arguments Value Author(s) References See Also Examples
Computes all "Relaxed Lasso" solutions.
1 |
X |
n x p-dimensional matrix or data frame containing the predictor variables; columns are supposed to be scaled and centered. |
Y |
n-dimensional numerical response vector; supposed to be centered to mean 0. |
phi |
Relaxation parameter in [0,1]. A value of phi=1 corresponds to the regular Lasso solutions; a value of phi=0 computes the OLS estimates on the set of variables selected by the Lasso. |
max.steps |
Maximal number of steps the LARS algorithm is run. |
fast |
Should the estimates be computed in approx. the same time as the LARS algorithm? If fast=TRUE, minor deviations from the original Relaxed Lasso solution can occur. |
keep.data |
Should the data be kept for later usage e.g. (when computing predicted values for the training data) ? |
warn |
If TRUE, warnings are given if the predictor variables X are not centered and scaled or if the reponse variable is not centered) ? |
An object of class relaxo
, for which plot and predict methods are available.
Nicolai Meinshausen nicolai@stat.berkeley.edu
N. Meinshausen, "Relaxed Lasso", Computational Statistics and Data Analysis, to appear. http://www.stat.berkeley.edu/~nicolai
See also cvrelaxo
for computation of the cross-validated solution with optimal predictive performance
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(diabetes)
## Center and scale variables
x <- scale(diabetes$x)
y <- as.numeric(scale(diabetes$y))
## Compute "Relaxed Lasso" solution and plot results
object <- relaxo(x,y)
plot(object)
## Compute cross-validated solution with optimal
## predictive performance and print relaxation parameter phi and
## penalty parameter lambda of the found solution
cvobject <- cvrelaxo(x,y)
print(cvobject$phi)
print(cvobject$lambda)
## Compute fitted values and plot them versus actual values
fitted.values <- predict(cvobject)
plot(fitted.values,y)
abline(c(0,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.