Learn R Programming

mogsa (version 1.6.4)

softK: Soft-thresholding operator

Description

Soft-thresholding operator, which is called by mbpca.

Usage

softK(x, k)

Arguments

x
A numerical vector
k
Number of non-zero elements want to keep

Value

A numerical vector

Examples

Run this code
v <- rnorm(10)
softK(v, k = 2)

Run the code above in your browser using DataLab