soft_threshold: Soft-threshold function

View source: R/hrf.R

soft_thresholdR Documentation

Soft-threshold function

Description

This function applies soft-thresholding to the input values, setting values below the threshold to zero and shrinking the remaining values by the threshold amount.

Usage

soft_threshold(x, threshold)

Arguments

x

A numeric vector of input values

threshold

A non-negative threshold value for the soft-thresholding operation

Value

A numeric vector with the soft-thresholded values

Examples

x <- c(-3, -2, -1, 0, 1, 2, 3)
threshold <- 1
soft_thresholded <- soft_threshold(x, threshold)
print(soft_thresholded)


bbuchsbaum/fmrireg documentation built on May 16, 2023, 10:56 a.m.