R/soft_thresholding.R

Defines functions soft_thresholding

Documented in soft_thresholding

## File Name: soft_thresholding.R
## File Version: 0.07


soft_thresholding <- function( x, lambda )
{
    x_abs <- abs(x)
    x <- ifelse( x_abs > lambda, x - sign(x) * lambda, 0 )
    return(x)
}


mlnormal_soft_thresholding <- soft_thresholding

Try the sirt package in your browser

Any scripts or data that you put into this service are public.

sirt documentation built on Aug. 11, 2023, 5:07 p.m.