LADlasso: LAD-Lasso for Linear Regression

View source: R/LAD.R

LADlassoR Documentation

LAD-Lasso for Linear Regression

Description

LAD-Lasso for Linear Regression

Usage

LADlasso(
  X,
  y,
  beta.ini,
  lambda = NULL,
  adaptive = TRUE,
  intercept = FALSE,
  penalty.factor = rep(1, ncol(X))
)

Arguments

X

design matrix, standardization is recommended.

y

reponse vector

beta.ini

initial estimates of beta. Using unpenalized LAD is recommended under high-dimensional setting.

lambda

regularization parameter of Lasso or adaptive Lasso (if adaptive=TRUE).

adaptive

logical input that indicates if adaptive Lasso is used. Default is TRUE.

intercept

logical input that indicates if intercept needs to be estimated. Default is FALSE.

penalty.factor

can be used to force nonzero coefficients. Default is rep(1, ncol(X)) as in glmnet.

Value

beta

the regression coefficient estimates.

fitted

predicted response.

iter.steps

iteration steps.

Examples

set.seed(2017)
n=200; d=50
X=matrix(rnorm(n*d), nrow=n, ncol=d)
beta=c(rep(2,6), rep(0, 44))
y=X%*%beta+c(rnorm(150), rnorm(30,10,10), rnorm(20,0,100))
output.LADLasso=LADlasso(X, y, beta.ini=LAD(X, y))
beta.est=output.LADLasso$beta


MTE documentation built on April 11, 2023, 6:11 p.m.