shrinkage | R Documentation |
Shrink a matrix using soft-thresholding or hard-thresholding.
shrinkage(x, gamma, shrink = c("soft", "hard"), epsilon = 1e-11)
x |
|
gamma |
|
shrink |
|
epsilon |
|
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.
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. |
Chen, F. and Rohe, K. (2020) "A New Basis for Sparse Principal Component Analysis."
prs
x <- matrix(1:6, nrow = 3)
shrink_x <- shrinkage(x, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.