elnet_coord: Elastic net regression

Usage Arguments

Usage

1
2
elnet_coord(X, Y, a = 0.5, lambda = 1, tol = 10^(-8),
  iterMax = 100, beta0 = rep(0, dim(X)[2]), GLMNET = FALSE)

Arguments

X

Covariate matrix

Y

Response vector

a

[0,1] specifying the relative weight between L1 penalty and L2 penalty

lambda

Non-negative parameter

tol

Tolerance error

iterMax

Maximum iteration times

beta0

Initial guess for coefficients beta

GLMNET

use 'glmnet' or not.

Solve the elastic net regression problem. And the objective function to be minimized here is

L = ||Y - X beta||_2^2 + lambda ((1 - a)||beta||_2^2 + a ||beta||_1).

elnet_coord(matrix(rnorm(300), nrow = 50), runif(50), beta0 = rep(1,4)) glmnet


sophiaycl/6520HW2 documentation built on June 6, 2019, 8:36 p.m.