svdR Documentation

Compute the singular-value decomposition on a large matrix.

Description

The difference between svd and fm.svd is that fm.svd allows a user-specified tol. svd computes eigenvalues in machine precision.

Usage

fm.svd(x, nu = min(n, p), nv = min(n, p), tol = 1e-08)

## S4 method for signature 'fm'
svd(x, nu = min(n, p), nv = min(n, p), LINPACK = FALSE)

Arguments

x

a FlashR matrix

nu

the number of left singluar vectors to be computed.

nv

the number of right singluar vectors to be computed.

tol

Stopping criterion: the relative accuracy of the Ritz value is considered acceptable if its error is less than 'tol' times its estimated value. If this is set to zero then machine precision is used.

Value

Returns a list with three entries

d

max(nu, nv) approximate singular values

u

nu approximate left singular vectors (only when right_only=FALSE)

v

nv approximate right singular vectors

Author(s)

Da Zheng <dzheng5@jhu.edu>

Examples

mat <- fm.runif.matrix(1000, 100)
res <- fm.svd(mat, nu=10, nv=0)
res <- svd(mat, nu=10, nv=0)