I have a symmetric matrix, X, and I just want the first K eigenvectors (those associated with the K largest eigenvalues). Clearly, this works:

eigs <- eigen( X, symmetric=TRUE )

K_eigenvectors <- eigs$vectors[ , 1:K ]
K_eigenvalues <- eigs$values[ 1:K ]

rm(eigs)

In order to do that, I have to create the matrix eigs$vectors which is the same size as X. Sometimes X has 100 million elements or more. Usually I want only the first 10 eigenvectors instead of all 10,000. Is there any R function that will allow me to extract just the few that I want? This would be analogous to the [V,d] = eigs(X,K) function in Octave/MATLAB.

Best,
Mike

--
Michael B. Miller, Ph.D.
Minnesota Center for Twin and Family Research
Department of Psychology
University of Minnesota
http://scholar.google.com/citations?user=EV_phq4AAAAJ

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to