hosvd: Calculate the (truncated) higher-order SVD (HOSVD).

Description Usage Arguments Details Value Author(s) References Examples

Description

Calculates the left singular vectors of each matrix unfolding of an array, then calculates the core array. The resulting output is a Tucker decomposition.

Usage

1
hosvd(Y, r = NULL)

Arguments

Y

An array of numerics.

r

A vector of integers. The rank of the truncated HOSVD.

Details

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).

Value

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.

Author(s)

Peter Hoff.

References

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.

Examples

 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)))


Search within the tensr package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.