#' 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))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.