Learn R Programming

AdapDiscom (version 1.0.0)

lambda_max: Compute Lambda Max for L1 Regularization using KKT Conditions

Description

Compute Lambda Max for L1 Regularization using KKT Conditions

Usage

lambda_max(X, y, Methode = "lasso", robust = 0)

Value

Maximum lambda value

Arguments

X

Matrix, design matrix

y

Vector, response vector

Methode

Character, method for computation

robust

Integer, 0 for classical, 1 for robust

Examples

Run this code
# Generate sample data
set.seed(123)
n <- 50; p <- 20
X <- matrix(rnorm(n*p), n, p)
y <- rnorm(n)

# Different methods for lambda_max computation
lmax_lasso <- lambda_max(X, y, Methode = "lasso")
lmax_discom <- lambda_max(X, y, Methode = "discom")

print(paste("Lambda max (lasso):", round(lmax_lasso, 4)))
print(paste("Lambda max (discom):", round(lmax_discom, 4)))

Run the code above in your browser using DataLab