soft.threshold: The function soft.threshold() soft-thresholds a vector such...

Description Usage Arguments Value Examples

View source: R/soft.threshold.R

Description

The function soft.threshold() soft-thresholds a vector such that the L1-norm constraint is satisfied.

Usage

1
soft.threshold(x, sumabs = 1)

Arguments

x

A numeric vector.

sumabs

A numeric constraint on x's L1 norm.

Value

Returns a vector resulting from the soft thresholding of x given sumabs

Examples

1
2
x <- rnorm(10)
soft.threshold(x,0.5)

Example output

 [1] -1.143352e-10  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
 [6]  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00

RGCCA documentation built on May 2, 2019, 3:39 p.m.