soft_thresholding: Soft Thresholding

View source: R/ShiVa.R

soft_thresholdingR Documentation

Soft Thresholding

Description

Applies the soft thresholding operation to a numeric input, commonly used in Lasso and sparse modeling to induce shrinkage and sparsity.

Usage

soft_thresholding(z, lambda)

Arguments

z

A numeric value to be thresholded.

lambda

A non-negative numeric value indicating the threshold level (degree of shrinkage).

Value

A numeric value after applying soft thresholding: \text{sign}(z) \cdot \max(|z| - \lambda, 0).


ShiVa documentation built on Aug. 22, 2025, 9:14 a.m.