lassoFit {EAinference} | R Documentation |
Compute lasso estimator
Description
Computes lasso, group lasso, scaled lasso, or scaled group lasso solution.
The outputs are coefficient-estimate and subgradient. If type = "slasso"
or type = "sgrlasso"
, the output will include estimated standard deviation.
Usage
lassoFit(X, Y, type, lbd, group = 1:ncol(X), weights = rep(1, max(group)),
verbose = FALSE, ...)
Arguments
X |
predictor matrix. |
Y |
response vector. |
type |
type of penalty. Must be specified to be one of the following:
|
lbd |
penalty term of lasso. By letting this argument be |
group |
|
weights |
weight vector with length equal to the number of groups. Default is
|
verbose |
logical. Only available for |
... |
auxiliary arguments for |
Details
Computes lasso, group lasso, scaled lasso, or scaled group lasso solution. Users can specify the value of lbd or choose to run cross-validation to get optimal lambda in term of mean squared error. Coordinate decent algorithm is used to fit scaled lasso and scaled group lasso models.
Value
B0 |
coefficient estimator. |
S0 |
subgradient. |
sigmaHat |
estimated standard deviation. |
lbd , weights , group |
same as input arguments. |
References
Mitra, R. and Zhang, C. H. (2016), "The benefit of group sparsity in group inference with de-biased scaled group lasso," Electronic Journal of Statistics, 10, 1829-1873.
Yang, Y. and Zou, H. (2015), “A Fast Unified Algorithm for Computing Group-Lasso Penalized Learning Problems,” Statistics and Computing, 25(6), 1129-1141.
Examples
set.seed(123)
n <- 50
p <- 10
X <- matrix(rnorm(n*p), n)
Y <- X %*% c(1, 1, rep(0, p-2)) + rnorm(n)
#
# lasso
#
lassoFit(X = X, Y = Y, type = "lasso", lbd = .5)
#
# group lasso
#
lassoFit(X = X, Y = Y, type = "grlasso", lbd = .5, weights = rep(1,2),
group = rep(1:2, each=5))
#
# scaled lasso
#
lassoFit(X = X, Y = Y, type = "slasso", lbd = .5)
#
# scaled group lasso
#
lassoFit(X = X, Y = Y, type = "sgrlasso", lbd = .5, weights = rep(1,2),
group = rep(1:2, each=5))