Select the number of significant principal components of a matrix via the Onatski method
eigengap.onatski(covmat, maxcomp = 50, maxiter = 100)
matrix to be decomposed
maximum number of eigenvalues to compute
maximum number of iterations
Onatski, A. (2010). Determining the number of factors from empirical distribution of eigenvalues. Review of Economics and Statistics, 92(4): 1004-1016