geneig: Generalized Eigenvalue Decomposition

View source: R/geneig.R

geneigR Documentation

Generalized Eigenvalue Decomposition

Description

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.

Usage

geneig(A, B, ncomp, method = c("robust", "sdiag", "geigen", "primme"), ...)

Arguments

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:

  • "robust": Uses a stable decomposition via a whitening transform (requires B to be symmetric positive-definite).

  • "sdiag": Uses a spectral decomposition of B and transforms the problem, works when B is symmetric positive-definite.

  • "geigen": Uses the geigen package for a general solution.

  • "primme": Uses the PRIMME package for large sparse matrices.

...

Additional arguments passed to the underlying methods.

Value

An object of class projector with eigenvalues stored in values and standard deviations in sdev = sqrt(values).

Examples

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)
}

bbuchsbaum/multivarious documentation built on Dec. 23, 2024, 7:47 a.m.