RSAVS_Softthresh: Soft thresh hold

View source: R/update_functions.R

RSAVS_SoftthreshR Documentation

Soft thresh hold

Description

This function performs the so-called 'soft threshholding' on the input vector(invec) based on the given threshholding value(thresh)

Usage

RSAVS_Softthresh(invec, thresh)

Arguments

invec

numerical vector, the original input value

thresh

non-negative scalar, the threshholding point

Value

outvec. For each input entry invec[i], the output value outvec[i] is

  • outvec[i] = invec[i] - thresh: if invec[i] > thresh

  • outvec[i] = invec[i] + thresh: if invec[i] < -thresh

  • outvec[i] = 0: if otherwise

Examples

RSAVS:::RSAVS_Softthresh(seq(-2, 2, by = 0.1), thresh = 1)

fenguoerbian/RSAVS documentation built on Oct. 25, 2024, 3:16 p.m.