Learn R Programming

DESP (version 0.1-2)

sqR_Lasso: computation of beta that minimize |Y-X*beta|_2 + lambda |beta|_1 (square-root Lasso)

Description

This function estimates the vector of regression coefficient under sparsity constraints, by square-root Lasso. That is, beta which minimize |Y-X*beta|_2 + lambda |beta|_1.

Usage

sqR_Lasso(X, Y, lambda, solver)

Arguments

X
The matrix of explanatory variables.
Y
The response variable.
lambda
The penalization parameter.
solver
The solver.

Value

  • The coefficient vector.

Details

This method can use the Mosek solver, the Gurobi solver or (by default) the SCS solver.

See Also

mosek,gurobi,scsSOCP

Examples

Run this code
## set the design matrix
X <- matrix(c(1,0,2,2,1,0,-1,1,1,2,0,1),4,3,byrow=TRUE)
## set the vector of observations
Y <- c(1,0,2,1)
## set the penalty level
lambda <- 1
## compute the Lasso estimate using SCS
sqR_Lasso(X, Y, lambda, solver="SCS")

Run the code above in your browser using DataLab