Description Usage Arguments Details Value Author(s) References Examples
Calculates the left singular vectors of each matrix unfolding of an array, then calculates the core array. The resulting output is a Tucker decomposition.
1 |
Y |
An array of numerics. |
r |
A vector of integers. The rank of the truncated HOSVD. |
If r
is equal to the rank of Y
, then Y
is equal to
atrans(S, U)
, up to numerical accuracy.
More details on the HOSVD can be found in De Lathauwer et. al. (2000).
U
A list of matrices with orthonormal columns. Each matrix
contains the mode-specific singular vectors of its mode.
S
An all-orthogonal array. This is the core array from the HOSVD.
Peter Hoff.
De Lathauwer, L., De Moor, B., & Vandewalle, J. (2000). A multilinear singular value decomposition. SIAM journal on Matrix Analysis and Applications, 21(4), 1253-1278.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #Generate random data.
p <- c(2, 3, 4)
X <- array(stats::rnorm(prod(p)), dim = p)
#Calculate HOSVD.
hosvd_x <- hosvd(X)
S <- hosvd_x$S
U <- hosvd_x$U
#Recover X.
trim(X - atrans(S, U))
#S is all-orthogonal.
trim(mat(S, 1) %*% t(mat(S, 1)))
trim(mat(S, 2) %*% t(mat(S, 2)))
trim(mat(S, 3) %*% t(mat(S, 3)))
|
, , 1
[,1] [,2] [,3]
[1,] 0 0 0
[2,] 0 0 0
, , 2
[,1] [,2] [,3]
[1,] 0 0 0
[2,] 0 0 0
, , 3
[,1] [,2] [,3]
[1,] 0 0 0
[2,] 0 0 0
, , 4
[,1] [,2] [,3]
[1,] 0 0 0
[2,] 0 0 0
[,1] [,2]
[1,] 12.50138 0.000000
[2,] 0.00000 7.510044
[,1] [,2] [,3]
[1,] 9.400672 0.000000 0.000000
[2,] 0.000000 6.730014 0.000000
[3,] 0.000000 0.000000 3.880738
[,1] [,2] [,3] [,4]
[1,] 9.769635 0.000000 0.000000 0.00000
[2,] 0.000000 5.538185 0.000000 0.00000
[3,] 0.000000 0.000000 3.078894 0.00000
[4,] 0.000000 0.000000 0.000000 1.62471
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.