Computes the singular-value decomposition of a rectangular matrix.
svdcpp(X, outtransform = 1L, decreasing = 1L)
A list with the following components:
d
: A vector containing the singular values of
U
: A matrix whose columns contain the left singular vectors
of
V
: A matrix whose columns contain the right singular vectors
of
A numeric matrix whose SVD decomposition is to be computed.
Whether the orthogonal matrices composing of the left and right singular vectors are to be computed.
Whether the singular values should be sorted in decreasing order and the corresponding singular vectors rearranged accordingly.
Kaifeng Lu, kaifenglu@gmail.com
Given
Gene N. Golub and Charles F. Van Loan. Matrix Computations, second edition. Baltimore, Maryland: The John Hopkins University Press, 1989, p.434.
A <- matrix(c(1,0,0,0, 1,2,0,0, 0,1,3,0, 0,0,1,4), 4, 4)
svdcpp(A)
Run the code above in your browser using DataLab