R/penalty_D1_mcp.R

Defines functions penalty_D1_mcp

## File Name: penalty_D1_mcp.R
## File Version: 0.03


penalty_D1_mcp <- function(x, lambda, eps, a=2.7)
{
    x <- abs(x)
    res <- ifelse( x < a*lambda, lambda*sqrt(x^2 + eps) - x^2 / (2*a), .5*a*lambda^2)
    return(res)
}

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.