shrinkage: Shrinkage

View source: R/utility.R

shrinkageR Documentation

Shrinkage

Description

Shrink a matrix using soft-thresholding or hard-thresholding.

Usage

shrinkage(x, gamma, shrink = c("soft", "hard"), epsilon = 1e-11)

Arguments

x

matrix or Matrix, to be threshold.

gamma

numeric, the constraint of Lp norm, i.e. \|x\|\le \gamma.

shrink

character(1), shrinkage method, either "soft"- (default) or "hard"-thresholding (see details).

epsilon

numeric, precision tolerance. This should be greater than .Machine$double.eps.

Details

A binary search to find the cut-off value.

shrink: The shrink option specifies the shrinkage operator to use. Currently, there are two build-in options—“soft”- and “hard”-thresholding. The “soft”-thresholding universally reduce all elements and sets the small elements to zeros. The “hard”-thresholding only sets the small elements to zeros.

Value

a list with two components:

matrix

matrix, the matrix that results from soft-thresholding

norm

numeric, the norm of the matrix after soft-thresholding. This value is close to constraint if using the second option.

References

Chen, F. and Rohe, K. (2020) "A New Basis for Sparse Principal Component Analysis."

See Also

prs

Examples

x <- matrix(1:6, nrow = 3)
shrink_x <- shrinkage(x, 1)


epca documentation built on July 26, 2023, 5:47 p.m.