softK: Soft-thresholding operator

Description Usage Arguments Value Author(s) Examples

View source: R/softK.R

Description

Weighted soft-thresholding operator, which is called by mbpca.

Usage

1
softK(x, k, w = 1, pos = FALSE)

Arguments

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.

Value

A thresholded numerical vector

Author(s)

Chen Meng

Examples

1
2
v <- rnorm(10)
softK(v, k = 2)

mengchen18/mogsa documentation built on June 7, 2020, 6:05 p.m.