runSVD: Run SVD

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Perform a singular value decomposition on an input matrix with a specified algorithm.

Usage

1
2
runSVD(x, k, nu=k, nv=k, center=FALSE, scale=FALSE, 
    BPPARAM=SerialParam(), ..., BSPARAM=ExactParam())

Arguments

x

A numeric matrix-like object to use in the SVD.

k

Integer scalar specifying the number of singular values to return.

nu

Integer scalar specifying the number of left singular vectors to return.

nv

Integer scalar specifying the number of right singular vectors to return.

center

Numeric vector, logical scalar or NULL, specifying values to subtract from each column of x - see ?"BiocSingular-options".

scale

Numeric vector, logical scalar or NULL, specifying values to divide each column of x - see ?"BiocSingular-options".

BPPARAM

A BiocParallelParam object specifying how parallelization should be performed.

...

Further arguments to pass to specific methods.

BSPARAM

A BiocSingularParam object specifying the type of algorithm to run.

Details

The class of BSPARAM will determine the algorithm that is used, see ?BiocSingularParam for more details. The default is to use an exact SVD via runExactSVD.

Value

A list containing:

Author(s)

Aaron Lun

See Also

runExactSVD, runIrlbaSVD and runRandomSVD for the specific functions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
a <- matrix(rnorm(100000), ncol=20)

out.exact0 <- runSVD(a, k=4)
str(out.exact0)

out.exact <- runSVD(a, k=4, BSPARAM=ExactParam())
str(out.exact)

out.irlba <- runSVD(a, k=4, BSPARAM=IrlbaParam())
str(out.exact)

out.random <- runSVD(a, k=4, BSPARAM=RandomParam())
str(out.random)

BiocSingular documentation built on Nov. 8, 2020, 10:59 p.m.