eigen1 | R Documentation |
Compute the leading eigenvalue for a square matrix
eigen1(m, ..., method = "power_iteration") eigen1_power_iteration( m, max_iterations = 100, tolerance = sqrt(.Machine$double.eps), initial = NULL, ... ) eigen1_base(m, ...)
m |
A matrix or 3d array |
... |
Ignored arguments |
method |
Select the method to use. Currently only "power_iteration" and "base" are supported |
max_iterations |
Integer, giving the number of iterations before giving up |
tolerance |
Number, giving the required tolerance |
initial |
An optional initial guess at the eigenvector. If omitted we use a random vector |
This function exposes two different methods for computing the leading eigenvalue of a matrix. The "base" method simply uses eigen but allows 3d arrays (returning a vector of leading eigenvalues). The "power_iteration" method uses the power iteration method which will work well if there is a significant difference between the first and second eigenvalues.
A scalar real (if m
is a matrix) or a vector with length
dim(m)[3]
if m
was a 3d array
m <- diag(runif(10)) eigen1::eigen1(m) max(eigen(m)$values)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.