irlba {irlba} R Documentation

## Find a few approximate singular values and singular vectors of a matrix.

### Description

The augmented implicitly restarted Lanczos bi-diagonalization (IRLBA) algorithm finds a few approximate singular values and corresponding singular vectors of a matrix using a method of Baglama and Reichel. It is a fast and memory-efficient way to compute a partial SVD.

### Usage

```irlba(A, nu = 5, nv = 5, adjust = 3, aug = c("ritz","harm"),
sigma = c("ls","ss"), maxit = 1000, m_b = 20, reorth = 2,
tol = 1e-06, V = NULL, matmul = NULL)
```

### Arguments

 `A` A double-precision real or complex matrix or real sparse matrix `nu` Number of desired left singular vectors `nv` Number of desired right singular vectors `adjust` Number of extra approximate singular values to compute to enhance convergence `aug` "ritz" for Ritz "harm" for harmonic Ritz vector augmentation `sigma` "ls" for largest few singular values, "ss" for smallest `maxit` Maximum number of iterations `m_b` Size of the projected bidiagonal matrix `reorth` Either 1 or 2: full (2) or one-sided (1) reorthogonalization `tol` Convergence is determined when ||A*V - U*S|| <= tol*||A||, where ||A|| is approximated by the largest singular value of all projection matrices. `V` Optional matrix of approximate right singular vectors `matmul` Option matrix multiply function–if specified, matmul must be a function that takes three arguments: `A, B, transpose` and computes `A %*% B` if `transpose=FALSE` or `t(A) %*% B` if `transpose=TRUE`.

### Details

The syntax of `irlba` largely conforms to `svd`, with an important exception. The usual R `svd` function always returns a complete set of singular values, even if the number of singular vectors `nu` or `nv` is set less than the maximum. The `irlba` function returns a number of singular values equal to the maximum of the number of specified singular vectors `nu` and `nv`.

### Value

 `d` max (nu, nv) approximate singular values `u` nu approximate left singular vectors `v` nv approximate right singular vectors `iter` The number of Lanczos iterations carried out `mprod` The total number of matrix vector products carried out

### Author(s)

Adapted for R by B. W. Lewis <blewis@illposed.net>

### References

"Augmented Implicitly Restarted Lanczos Bidiagonalization Methods", J. Baglama and L. Reichel, SIAM J. Sci. Comput. 2005.

### Examples

```A <- matrix(runif(100*100),100,100)
S <- irlba (A)
S\$d
```

[Package irlba version 1.0.3 Index]