View source: R/tensor_decompositions.R
get_isvd | R Documentation |
The ISVD is a generalization of the SVD to tensors. It is derived from the incredible HOLQ.
get_isvd(x_holq)
x_holq |
The output from |
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).
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.
David Gerard.
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
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.