# Solvers for Large Scale Eigenvalue and SVD Problems

Previously an R wrapper of the 'ARPACK' library < http://www.caam.rice.edu/software/ARPACK/>, and now a shell of the R package 'RSpectra', an R interface to the 'Spectra' library < http://yixuan.cos.name/spectra/> for solving large scale eigenvalue/vector problems. The current version of 'rARPACK' simply imports and exports the functions provided by 'RSpectra'. New users of 'rARPACK' are advised to switch to the 'RSpectra' package.

### Introduction

rARPACK is an R wrapper of the ARPACK library to solve large scale eigen value/vector problems. It is typically used to compute a few eigen values/vectors of an `n` by `n` matrix, e.g., the `k` largest eigen values, which is usually more efficient than `eigen()` if `k << n`.

Currently this package provides function `eigs()` for eigenvalue/eigenvector problems, and `svds()` for truncated SVD. Different matrix types in R, including sparse matrices, are supported. Below is a list of implemented ones:

• `matrix` (defined in base R)
• `dgeMatrix` (defined in Matrix package, for general matrices)
• `dsyMatrix` (defined in Matrix package, for symmetric matrices)
• `dgCMatrix` (defined in Matrix package, for column oriented sparse matrices)
• `dgRMatrix` (defined in Matrix package, for row oriented sparse matrices)
• `function` (implicitly specify the matrix by providing a function that calculates matrix product `A %*% x`)

### Example

We first generate some matrices:

General matrices have complex eigenvalues:

rARPACK also works on sparse matrices:

Function interface is also supported:

Symmetric matrices have real eigenvalues.

To find the smallest (in absolute value) `k` eigenvalues of `A5`, we have two approaches:

The results should be the same, but the latter method is far more stable on large matrices.

For SVD problems, you can specify the number of singular values (`k`), number of left singular vectors (`nu`) and number of right singular vectors(`nv`).

Similar to `eigs()`, `svds()` supports sparse matrices:

# News

``````  CHANGES IN rARPACK VERSION 0.7-0
``````

NEW FEATURES

``````o Support for implicit matrix, contributed by Jiali Mei.
User can supply a function FUN rather than an explicit matrix
to eigs(), and the eigenvalues/eigenvectors of this operator
will be computed. FUN(x, args) must return a vector of the same
length as x.

o eigs() will test the symmetry of matrix before actual computation,
since symmetric matrices can guarantee real eigenvalues and
eigenvectors, and the numerical result is more stable.
``````

BUG FIXES

``````o C++ code of svds() is completely rewritten. Now it is more readable
and easier to maintain.

o Fix a bug possibly coming from ARPACK, which sometimes gives
incorrect result of complex eigenvectors.

o Avoid using a C random number generator.

CHANGES IN rARPACK VERSION 0.6-0
``````

NEW FEATURES

``````o Add support for new matrix types: dgeMatrix and dgRMatrix.

o eigs() now allows a full Eigen Decomposition, meaning that
all the eigenvalues are calculated. In this case eigs() is
simply a wrapper of eigen(), and with a warning issued.

o Ditto for svds()
``````

BUG FIXES

``````o Rewrite C++ code using classes and templates.

o Fix errors in checking the values of k and ncv.

CHANGES IN rARPACK VERSION 0.5-0
``````

NEW FEATURES

``````o Add svds() function to calculate truncated SVD.
``````

BUG FIXES

``````o Now sort eigenvalues in decreasing order.

o Rename eigs.sym() to eigs_sym() to avoid confusion.

o Fix a matrix out-of-bound error.

CHANGES IN rARPACK VERSION 0.4-0
``````

NEW FEATURES

``````o Implement shift-and-invert mode for all supported eigen problems.
``````

BUG FIXES

``````o Update arpack-ng to 3.1.4

CHANGES IN rARPACK VERSION 0.3-0
``````

NEW FEATURES

``````o Now eigs() supports real symmetric matrices.

CHANGES IN rARPACK VERSION 0.2-0
``````

NEW FEATURES

``````o Now eigs() supports sparse real nonsymmetric matrices of the class
"dgCMatrix", defined in the Matrix package.

CHANGES IN rARPACK VERSION 0.1-0
``````

NEW FEATURES

``````o Initial version. For now eigs() supports dense real nonsymmetric matrices.
``````

# Reference manual

install.packages("rARPACK")

0.11-0 by Yixuan Qiu, 5 years ago

https://github.com/yixuan/rARPACK

Report a bug at https://github.com/yixuan/rARPACK/issues

Browse source code at https://github.com/cran/rARPACK

Authors: Yixuan Qiu , Jiali Mei and authors of the ARPACK library. See file AUTHORS for details.

Documentation:   PDF Manual

Imports RSpectra

Suggests Matrix

Imported by CISE, FACTMLE, FILEST, FKSUM, HDclassif, KRIS, accSDA, clustrd, coxmeg, lfda, mimi, roots, spmoran, statGraph, stocc.

Depended on by FastKM, POINT, PPCI, lori.

Suggested by RDFTensor, logisticPCA, primer.

See at CRAN