R/soft.R

Defines functions soft

#' the function soft() encodes the soft-thresholding operator
#' @param x numeric vector on which soft-thresholding is applied
#' @param d numeric, threshold
#' @noRd
soft <- function(x, d) {
  return(sign(x) * pmax(0, abs(x) - d))
}

Try the RGCCA package in your browser

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

RGCCA documentation built on May 29, 2024, 9:59 a.m.