This is a short code for studying admm for lasso.
#--------------------------- functions to be used ----------------------
## the main function f = g + h
f <- function(x, A, b, lambda){
1/2*norm(A %*% x - b, "2")^2 + lambda*sum(abs(x))
}
## smooth function g
g <- function(x, A, b){
1/2*norm(A %*% x - b, "2")^2
}
## proximal function of none smooth function h
prox_L1 <- function(x,