partial_eigen {irlba} | R Documentation |
Use partial_eigen
to estimate a subset of the largest (most positive)
eigenvalues and corresponding eigenvectors of a symmetric dense or sparse
real-valued matrix.
partial_eigen(x, n = 5, symmetric = TRUE, ...)
x |
numeric real-valued dense or sparse matrix. |
n |
number of largest eigenvalues and corresponding eigenvectors to compute. |
symmetric |
|
... |
optional additional parameters passed to the |
Returns a list with entries:
values n approximate largest eigenvalues
vectors n approximate corresponding eigenvectors
Specify symmetric=FALSE
to compute the largest n
eigenvalues
and corresponding eigenvectors of the symmetric matrix cross-product
t(x) %*% x
.
This function uses the irlba
function under the hood. See ?irlba
for description of additional options, especially the tol
parameter.
Augmented Implicitly Restarted Lanczos Bidiagonalization Methods, J. Baglama and L. Reichel, SIAM J. Sci. Comput. 2005.
set.seed(1) # Construct a symmetric matrix with some positive and negative eigenvalues: V <- qr.Q(qr(matrix(runif(100),nrow=10))) x <- V %*% diag(c(10, -9, 8, -7, 6, -5, 4, -3, 2, -1)) %*% t(V) partial_eigen(x, 3)$values # Compare with eigen eigen(x)$values[1:3]