R/softthresh.R

Defines functions softsh

####### Soft-threshhold
softsh <- function(u, eta)
{
    if( eta < abs(u) ){
        if( u > 0 ) {
            ss <- u - eta
        } else {
            ss <- u + eta
        }
    } else {
        ss <- 0
    }
    return(ss)
}

Try the spcr package in your browser

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

spcr documentation built on Oct. 16, 2022, 9:05 a.m.