geneig | R Documentation |
Computes the generalized eigenvalues and eigenvectors for the problem: A x = λ B x. Various methods are available and differ in their assumptions about A and B.
geneig(A, B, ncomp, method = c("robust", "sdiag", "geigen", "primme"), ...)
A |
The left-hand side square matrix. |
B |
The right-hand side square matrix, same dimension as A. |
ncomp |
Number of eigenpairs to return. |
method |
Method to compute the eigenvalues and eigenvectors:
|
... |
Additional arguments passed to the underlying methods. |
An object of class projector
with eigenvalues stored in values
and standard deviations in sdev = sqrt(values)
.
if (requireNamespace("geigen", quietly = TRUE)) {
A <- matrix(c(14, 10, 12, 10, 12, 13, 12, 13, 14), nrow=3, byrow=TRUE)
B <- matrix(c(48, 17, 26, 17, 33, 32, 26, 32, 34), nrow=3, byrow=TRUE)
res <- geneig(A, B, ncomp=3, method="geigen")
# res$values and coefficients(res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.