R/cdm_penalty_values_scad.R

Defines functions cdm_penalty_values_scad

## File Name: cdm_penalty_values_scad.R
## File Version: 0.18

cdm_penalty_values_scad <- function( x, lambda, a=3.7 )
{
    y <- lambda * abs(x)
    y <- ifelse( ( abs(x) > lambda ) & ( abs(x) < a*lambda ),
                    -( x^2 - 2*a*lambda*abs(x) + lambda^2 )/ 2 / ( a-1),   y )
    y <- ifelse(  abs(x) > a*lambda,  (a+1) * lambda^2 / 2, y )
    return(y)
}

Try the CDM package in your browser

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

CDM documentation built on Aug. 25, 2022, 5:08 p.m.