| power.method {fastmatrix} | R Documentation |
The power method seeks to determine the eigenvalue of maximum modulus, and a corresponding eigenvector.
power.method(x, only.value = FALSE, maxiter = 100, tol = 1e-8)
x |
a symmetric matrix. |
only.value |
if |
maxiter |
the maximum number of iterations. Defaults to |
tol |
a numeric tolerance. |
When only.value is not true, as by default, the result is a list with components
"value" and "vector". Otherwise only the dominan eigenvalue is returned.
The performed number of iterations to reach convergence is returned as attribute "iterations".
eigen for eigenvalues and eigenvectors computation.
n <- 1000 x <- .5 * diag(n) + 0.5 * matrix(1, nrow = n, ncol = n) # dominant eigenvalue must be (n + 1) / 2 z <- power.method(x, only.value = TRUE)