soft_threshold | R Documentation |
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.
soft_threshold(x, threshold)
x |
A numeric vector of input values |
threshold |
A non-negative threshold value for the soft-thresholding operation |
A numeric vector with the soft-thresholded values
x <- c(-3, -2, -1, 0, 1, 2, 3)
threshold <- 1
soft_thresholded <- soft_threshold(x, threshold)
print(soft_thresholded)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.