Description Usage Arguments Details Examples
Soft-threshold, and then normalize the result to L2-norm of 1. Care is taken with vectors of L2-norm empirically equal to zero.
1 | soft_l2norm(x, lambda)
|
x |
Vector to be soft-thresholded |
lambda |
Threshold value |
This function is not exported, as it is an internal utility function. Use
spca:::soft_l2norm
to access it.
1 2 3 4 5 6 7 8 | set.seed(1)
(z <- rnorm(10))
spca:::soft_l2norm(z, 0.5)
sqrt(sum(spca:::soft_l2norm(z, 0.5)^2))
(z <- rnorm(100))
spca:::soft_l2norm(z, 0.75)
sqrt(sum(spca:::soft_l2norm(z, 0.5)^2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.