File: runSVD.Rd

package info (click to toggle)
r-bioc-biocsingular 1.6.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 364 kB
  • sloc: cpp: 57; sh: 13; makefile: 2
file content (69 lines) | stat: -rw-r--r-- 2,381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
\name{runSVD}
\alias{runSVD}
\alias{runSVD,missing-method}
\alias{runSVD,ExactParam-method}
\alias{runSVD,IrlbaParam-method}
\alias{runSVD,RandomParam-method}
\alias{runSVD,FastAutoParam-method}
\docType{methods}

\title{Run SVD}
\description{Perform a singular value decomposition on an input matrix with a specified algorithm.}

\usage{
runSVD(x, k, nu=k, nv=k, center=FALSE, scale=FALSE, 
    BPPARAM=SerialParam(), ..., BSPARAM=ExactParam())
}

\arguments{
\item{x}{A numeric matrix-like object to use in the SVD.}
\item{k}{Integer scalar specifying the number of singular values to return.}
\item{nu}{Integer scalar specifying the number of left singular vectors to return.}
\item{nv}{Integer scalar specifying the number of right singular vectors to return.}
\item{center}{Numeric vector, logical scalar or \code{NULL}, specifying values to subtract from each column of \code{x} - see \code{?"\link{BiocSingular-options}"}.}
\item{scale}{Numeric vector, logical scalar or \code{NULL}, specifying values to divide each column of \code{x} - see \code{?"\link{BiocSingular-options}"}.}
\item{BPPARAM}{A \linkS4class{BiocParallelParam} object specifying how parallelization should be performed.}
\item{...}{Further arguments to pass to specific methods.}
\item{BSPARAM}{A \linkS4class{BiocSingularParam} object specifying the type of algorithm to run.}
}

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

\value{
A list containing:
\itemize{
\item \code{d}, a numeric vector of the first \code{k} singular values.
\item \code{u}, a numeric matrix with \code{nrow(x)} rows and \code{nu} columns.
Each column contains a left singular vector.
\item \code{u}, a numeric matrix with \code{ncol(x)} rows and \code{nv} columns.
Each column contains a right singular vector.
}
}

\author{
Aaron Lun
}

\seealso{
\code{\link{runExactSVD}}, \code{\link{runIrlbaSVD}} and \code{\link{runRandomSVD}} for the specific functions.
}

\examples{
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)
}