eigs {ConnMatTools}R Documentation

Compute some eigenvalues of a matrix

Description

This function computes a limited number of eigenvalues and eigenvectors of a matrix. It uses arpack function from the igraph package. If this package is not available, it will use the standard eigen function to do the calculation, but will issue a warning.

Usage

eigs(
  M,
  nev = min(dim(M)[1] - 1, 1),
  sym = sum(abs(M - t(M)))/sum(abs(M)) < 1e-10,
  which = "LM",
  use.arpack = TRUE,
  options.arpack = NULL
)

Arguments

M

a matrix.

nev

number of eigenvalues and eigenvectors to return

sym

A boolean indicating if matrix is symmetric or not. Defaults to checking if this is the case or not.

which

A character string indicating which eigenvalues to return. Defaults to "LM", meaning largest magnitude eigenvalues. If not using arpack, then "SM" is also a possibility to return the smallest magnitude eigenvalues. If using arpack, then a number of options are possible, though they are not all guaranteed to work for all use cases. See that function for more details.

use.arpack

Boolean determining if calculation is to be done with arpack function from the igraph package. This is much quicker for large matrices, but requires igraph. Defaults to TRUE, but will use eigen instead if igraph is not found.

options.arpack

Additional options for arpack. See that function for details. Not all options are compatible with this function.

Value

A list with at least the following two items:

values

A set of eigenvalues

vectors

A matrix of eigenvectors

Author(s)

David M. Kaplan dmkaplan2000@gmail.com

See Also

See also arpack


[Package ConnMatTools version 0.3.5 Index]