Y <- matrix(rnorm(1e6)/sqrt(1e3),nrow=1e3)
# Y is a 1000x1000 i.i.d. Gaussian matrix
val <- ScreeNOT::adaptiveHardThresholding(Y, 10)
# Runs the ScreeNOT procedure, with an upper bound k=10
cat('Computed threshold: ', val$Topt)
# The adaptively computed threshold
cat('Known optimal threshold: ', 4/sqrt(3))
# The known optimal threshold for this noise bulk
Run the code above in your browser using DataLab