get_isvd {tensr}R Documentation

Calculate the incredible SVD (ISVD).

Description

The ISVD is a generalization of the SVD to tensors. It is derived from the incredible HOLQ.

Usage

get_isvd(x_holq)

Arguments

x_holq

The output from holq.

Details

Let sig * atrans(Z, L) be the HOLQ of X. Then the ISVD calculates the SVD of each L[[i]], call it U[[i]] %*% D[[i]] %*% t(W[[i]]). It then returns l = sig, U, D, and V = atrans(Z, W). These values have the property that X is equal to l * atrans(atrans(V, D), U), up to numerical precision. V is also scaled all-orthonormal.

For more details on the ISVD, see Gerard and Hoff (2016).

Value

l A numeric.

U A list of orthogonal matrices.

D A list of diagonal matrices with positive diagonal entries and unit determinant. The diagonal entries are in descending order.

V A scaled all-orthonormal array.

Author(s)

David Gerard.

References

Gerard, D., & Hoff, P. (2016). A higher-order LQ decomposition for separable covariance models. Linear Algebra and its Applications, 505, 57-84. https://doi.org/10.1016/j.laa.2016.04.033 http://arxiv.org/pdf/1410.1094v1.pdf

Examples

#Generate random data.
p <- c(4,4,4)
X <- array(stats::rnorm(prod(p)), dim = p)

#Calculate HOLQ, then ISVD
holq_x <- holq(X)
isvd_x <- get_isvd(holq_x)
l <- isvd_x$l
U <- isvd_x$U
D <- isvd_x$D
V <- isvd_x$V

#Recover X
trim(X - l * atrans(atrans(V, D), U))

#V is scaled all-orthonormal
trim(mat(V, 1) %*% t(mat(V, 1)), epsilon = 10^-5)

trim(mat(V, 2) %*% t(mat(V, 2)), epsilon = 10^-5)

trim(mat(V, 3) %*% t(mat(V, 3)), epsilon = 10^-5)

[Package tensr version 1.0.1 Index]