softK {mogsa} | R Documentation |
Weighted soft-thresholding operator, which is called by mbpca
.
softK(x, k, w = 1, pos = FALSE)
x |
A numerical vector |
k |
Number of non-zero elements want to keep |
w |
weight for each element. The actual thresholding is base on x*w, the default setting equals to ordinary soft thresholding. |
pos |
A logical value, if only positive values are retained. |
A thresholded numerical vector
Chen Meng
v <- rnorm(10) softK(v, k = 2)