View source: R/optimal_SVHT_coef.R
sv_threshold | R Documentation |
Singular value thresholding evaluates the optimal number of singular values to retain
sv_threshold(n, p, d)
n |
number of samples |
p |
number of features |
d |
singular values |
Number of singular values to retain
Gavish, M., & Donoho, D. L. (2014). The optimal hard threshold for singular values is 4/sqrt(3). IEEE Transactions on Information Theory, 60(8), 5040-5053.
# simulate data
n <- 500
p <- 5000
Y <- Rfast::matrnorm(n, p, seed = 1)
# SVD
dcmp <- svd(Y)
# how many components to retain
sv_threshold(n, p, dcmp$d)
# in this case the data has no structure, so no components are retained
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.