R/hard_thresholding.R

Defines functions hard_thresholding

Documented in hard_thresholding

## File Name: hard_thresholding.R
## File Version: 0.06


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

Try the sirt package in your browser

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

sirt documentation built on May 29, 2024, 8:43 a.m.