Learn R Programming

guidedPLS (version 1.0.0)

softThr: Soft-thresholding to make a sparse vector sparse

Description

The degree of the sparseness of vector is controlled by the lambda parameter.

Usage

softThr(y, lambda=1)

Value

A numerical vector, whose length is the same as that of y.

Arguments

y

A numerical vector.

lambda

Threshold value to convert a value 0. If the absolute value of an element of vector is less than lambda, the value is converted to 0 (Default: 1).

Author

Koki Tsuyuzaki

Examples

Run this code
y <- seq(-2, 2, 0.1)
softThr(y)

Run the code above in your browser using DataLab