soft: Soft Thresholding Function

Description Usage Arguments Value Note Author(s) Examples

View source: R/utility_functions.R

Description

Soft Thresholding Function

Usage

1
soft(x, y, beta, lambda, weight)

Arguments

x

Design matrix of dimension n x q, where n is the number of subjects and q is the total number of variables; each row is an observation vector. This must include all main effects and interactions as well, with column names corresponding to the names of the main effects (e.g. x1, x2, E) and their interactions (e.g. x1:E, x2:E). All columns should be scaled to have mean 0 and variance 1; this is done internally by the shim function.

y

response variable (matrix form) of dimension n x 1

beta

vector of regression coefficients to be thresholded

lambda

tuning parameters

weight

vector of weights for each beta

Value

matrix of thresholded regression coefficients

Note

user must supply x AND y, or beta, but not both. I set it up this way because to get the sequence of lambdas, I use the beta argument so that I only compute this once. I use the x, y argument for the CV folds. lambda can be a vector and this functions will return each thresholded beta for each lambda

Author(s)

Sahir Bhatnagar

Maintainer: Sahir Bhatnagar [email protected]

Examples

1
 soft(beta = 0.5, lambda = seq(0.001,0.65,length.out = 10), weight = 1)

sahirbhatnagar/shim documentation built on May 25, 2017, 11:36 p.m.