tda_msvd returns just the singular values – TDA's
msvd. tda_msvd1 returns the full decomposition
A = U %*% diag(d) %*% t(V) – TDA's msvd1,
matching base R's svd() convention exactly (singular
vectors as columns of u/v). A must have at
least as many rows as columns for either. As with any singular
vector, each column's sign is arbitrary and need not match
svd()'s choice.
Value
tda_msvd returns a plain numeric vector of
singular values. tda_msvd1 returns a list: d, the
singular values; u, v, the singular vectors as
columns.
See also
Other matrix algebra:
tda_mcel(),
tda_mcent(),
tda_mch(),
tda_mcross(),
tda_mdiag(),
tda_mev(),
tda_mevs(),
tda_midf(),
tda_midf1(),
tda_midf2(),
tda_midf3(),
tda_minvs(),
tda_mkmet(),
tda_mkp(),
tda_mmul(),
tda_mnc(),
tda_mnrow(),
tda_mpbl(),
tda_mpfit(),
tda_mpinv(),
tda_mpit(),
tda_mple(),
tda_mpz(),
tda_mscal1(),
tda_msqrtd(),
tda_mwvec()
Examples
A <- matrix(c(1, 3, 5, 2, 4, 7), 3, 2)
tda_msvd(A) # == svd(A)$d
#> [1] 10.1914283 0.3671377
tda_msvd1(A) # == svd(A), up to per-column sign
#> $d
#> [1] 10.1914283 0.3671377
#>
#> $u
#> [,1] [,2]
#> [1,] 0.2167839 0.93892288
#> [2,] 0.4904541 -0.34146390
#> [3,] 0.8440732 -0.04273442
#>
#> $v
#> [,1] [,2]
#> [1,] 0.5797531 -0.8147922
#> [2,] 0.8147922 0.5797531
#>