adaplasso: Function for soft-thresholding

Description Usage Arguments Value Examples

View source: R/FunctionsALasso.R

Description

Function for soft-thresholding

Usage

1
adaplasso(Xstd, Ystd, beta, lambda)

Arguments

Xstd

n x p design matrix X scaled according to LARS algorithm and centered to mean 0

Ystd

n x 1 centered output vector

beta

p x 1 vector of parameters

lambda

tuning parameter(scalar)

Value

Objective function for adaplasso

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
X <- matrix(rnorm(500), 50, 10)
Y <- rnorm(50)
gamma <- 2
#Standardizing X and Y
std <- standardize(X , Y , gamma)
#Deriving weighted and centered design matrix
Xstd <- std$Xstd
#Deriving centered Y
Ystd <- std$Ystd
#Defining beta
beta <- solve(crossprod(X)) %*% t(X) %*% Y
#Lambda value
lambda <- 2
#Objective function
obj <- adaplasso(Xstd, Ystd, beta, lambda)

Saptati-Datta/AdapLasso documentation built on Dec. 18, 2021, 12:57 p.m.