sqrt_lasso {RPtests} | R Documentation |
Square-root Lasso regression
Description
Fits a linear model to potentially high-dimensional data using the square-root Lasso, also known as the scaled Lasso. The Lasso path is computed using the glmnet package.
Usage
sqrt_lasso(x, y, lam0 = NULL, exclude = integer(0), output_all = FALSE, ...)
Arguments
x |
Input matrix of dimension nobs by nvars; each row is an observation vector. |
y |
Response variable; shoud be a numeric vector. |
lam0 |
Tuning parameter for the square-root / scaled Lasso. If left blank (recommended) this is chosen using the method of Sun & Zhang (2013) implemented in the scalreg package. |
exclude |
Indices of variables to be excluded from the model; default is none. |
output_all |
In addition to the vector of coefficients, if |
... |
Additional arguments to be passed to |
Details
First the Lasso path is computed using glmnet
from
glmnet. Next the particular point on the path corresponding to the
square-root Lasso solution is found. As the path is only computed on a grid
of points, the square-root Lasso solution is approximate.
Value
Either an estimated vector of regression coefficients with nvars
components or, if output_all
is true
, a list with components
beta
the vector of regression coefficents
a0
an intercept term
sigma_hat
an estimate of the noise standard deviation; this is calculated as square-root of the average residual sums of squares
glmnet_obj
the fitted
glmnet
object, an S3 class “glmnet
"lamda_index
the index of the lambda vector in the
glmnet
object corresponding to the square-root Lasso solution
References
A. Belloni, V. Chernozhukov, and L. Wang. (2011) Square-root lasso: pivotal recovery of sparse signals via conic programming. Biometrika, 98(4):791-806.
T. Sun and C.-H. Zhang. (2012) Scaled sparse linear regression. Biometrika, 99(4):879-898.
T. Sun and C.-H. Zhang. (2013) Sparse matrix inversion with scaled lasso. The Journal of Machine Learning Research, 14(1):3385-3418.
See Also
Examples
x <- matrix(rnorm(100*250), 100, 250)
y <- x[, 1] + x[, 2] + rnorm(100)
out <- sqrt_lasso(x, y)