lassoFit: Compute lasso estimator

Description Usage Arguments Details Value References Examples

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

1
2
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: "lasso", "grlasso", "slasso" or "sgrlasso", which correspond to lasso, group lasso, scaled lasso or scaled group lasso.

lbd

penalty term of lasso. By letting this argument be "cv.1se" or "cv.min", users can have the cross-validated lambda that gives either minimum squared error or that is within 1 std error bound.

group

p x 1 vector of consecutive integers describing the group structure. The number of groups should be the same as max(group). Default is group = 1:p , where p is number of covariates.

weights

weight vector with length equal to the number of groups. Default is weights = rep(1, max(group)).

verbose

logical. Only available for type = "slasso" or type = "sgrlasso".

...

auxiliary arguments for lbd = "cv.min", lbd = "cv.1se". See cv.lasso for details.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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))

seunghyunmin/EAlasso documentation built on May 31, 2019, 8:31 a.m.