svd_byname | R Documentation |
The singular value decomposition decomposes matrix A into A = U D V^T, where U and V are orthogonal matrices and D is a diagonal matrix. U is the left singular vectors of A. V is the right singular vectors of A.
svd_byname(a, which = c("d", "u", "v"))
a |
A matrix to be decomposed. |
which |
The matrix to be returned. Default is "d". See details. |
which
determines the part of the singular value decomposition to be returned.
"d" (default) gives the D matrix.
"u" gives the U matrix.
"v" gives the V matrix (not its transpose).
A matrix of the singular value decomposition of a
.
A = matrix(c(4, 0,
3, -5), nrow = 2, ncol = 2, byrow = TRUE,
dimnames = list(c("r1", "r2"), c("c1", "c2"))) %>%
setrowtype("Product") %>% setcoltype("Industry")
A
svd_byname(A) # Gives D matrix, by default
svd_byname(A, which = "d")
svd_byname(A, which = "u")
svd_byname(A, which = "v")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.