Join us for
RADAR: AI Edition

r.jive (version 2.4)

svdwrapper: Wrapper Function to Perform SVD

Description

Performs SVD on a data matrix using the base svd() function in R, with a workaround to avoid LAPACK errors. If an SVD of the data matrix gives an error, an SVD of its transpose will be performed. Used internally when computing the JIVE decomposition. Credit to Art Owen: https://stat.ethz.ch/pipermail/r-help/2007-October/143508.html.

Usage

svdwrapper(x, nu, nv, verbose=F )

Arguments

x

a numeric matrix whos SVD decomposition is to be computed.

nu

the number of left singular vectors to be computed.

nv

the number of right singular vectors to be computed.

verbose

logical. Print error message if needed.

Value

An svd object, as returned by svd(x,nu=nu,nv=nv).

Examples

Run this code
# NOT RUN {
x<-matrix(rnorm(100),nrow=10,ncol=10)
SVD = svdwrapper(x,nu=1,nv=1)
# }

Run the code above in your browser using DataLab