Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

svdSafe

Safe SVD-like matrix decomposition


Description

SVD that traps errors and switches to QR when necessary

Usage

svdSafe(X)

Arguments

X

Matrix to decompose

Details

This function traps errors in the svd function due to numerically zero singular values, and replaces the operation with a QR decomposition. Technically, the R component of the decomposition fails the orthogonality constraint required for the SVD decomposition, but this function exists to save bootstraps from rudely failing; since the critical component of the SVD (in this application) is the left orthogonal matrix, this is a reasonable approximation for bootstrap purposes. If there are too many svd failures (which will will be reported by the function) then it is worth looking into the design matrix.

Value

A list as in what svd produces: U and V matrices as well as the d vector of singular values.

Author(s)

E. Andres Houseman

See Also


RefFreeEWAS

EWAS using Reference-Free DNA Methylation Mixture Deconvolution

v2.2
GPL (>= 2)
Authors
E. Andres Houseman, Sc.D.
Initial release
2018-12-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.