View source: R/tensor_decompositions.R
hooi | R Documentation |
This function will calculate the best rank r
(where r
is a
vector) approximation (in terms of sum of squared differences) to a given
data array.
hooi(X, r, tol = 10^-6, print_fnorm = FALSE, itermax = 500)
X |
An array of numerics. |
r |
A vector of integers. This is the given low multilinear rank of the approximation. |
tol |
A numeric. Stopping criterion. |
print_fnorm |
Should updates of the optimization procedure be printed? This number should get larger during the optimizaton procedure. |
itermax |
The maximum number of iterations to run the optimization procedure. |
Given an array X
, this code will find a core array G
and a list
of matrices with orthonormal columns U
that minimizes fnorm(X -
atrans(G, U))
. If r
is equal to the dimension of X
, then it
returns the HOSVD (see hosvd
).
For details on the HOOI see Lathauwer et al (2000).
G
An all-orthogonal core array.
U
A vector of matrices with orthonormal columns.
David Gerard.
De Lathauwer, L., De Moor, B., & Vandewalle, J. (2000). On the best rank-1 and rank-(r_1, r_2,..., r_n) approximation of higher-order tensors. SIAM Journal on Matrix Analysis and Applications, 21(4), 1324-1342.
## Generate random data. p <- c(2, 3, 4) X <- array(stats::rnorm(prod(p)), dim = p) ## Calculate HOOI r <- c(2, 2, 2) hooi_x <- hooi(X, r = r) G <- hooi_x$G U <- hooi_x$U ## Reconstruct the hooi approximation. X_approx <- atrans(G, U) fnorm(X - X_approx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.