R/softNeg.R

Defines functions softNeg

Documented in softNeg

#' Soft negative score
#'
#' @param Y matrix
#' @param tau coefficient to penalize for volume
#'
#' @return
#'
#' @examples
softNeg <- function(Y, tau) {
    z <- pmax(abs(Y + tau / 2) - tau / 2, 0)
    z <- z / (z + tau / 2) * (Y + tau / 2)
    return(z)
}
ctlab/LinSeed documentation built on Aug. 9, 2019, 4:33 p.m.