# NOT RUN {
truth <- matrix(rnorm(1000), nrow=100)
truth <- truth[,sample(ncol(truth), 1000, replace=TRUE)]
obs <- truth + rnorm(length(truth), sd=2)
# Note, we need the variance explained, NOT the percentage
# of variance explained!
pcs <- pca(obs)
chooseMarchenkoPastur(obs, var.explained=pcs$sdev^2, noise=4)
# }
Run the code above in your browser using DataLab