The Tucker decomposition of a tensor. Approximates a K-Tensor using a
n-mode product of a core tensor (with modes specified by
with orthogonal factor matrices. If there is no truncation in one of the modes,
then this is the same as the MPCA,
If there is no truncation in all the modes (i.e.
ranks = darr@modes),
then this is the same as the HOSVD,
This is an iterative algorithm, with two possible stopping conditions:
either relative error in Frobenius norm has gotten below
max_iter number of iterations has been reached.
For more details on the Tucker decomposition, consult Kolda and Bader (2009).
tucker(darr, ranks=NULL, max_iter=25, tol=1e-05) ## S4 method for signature 'DelayedArray' tucker(darr, ranks, max_iter, tol)
Tensor with K modes
a vector of the modes of the output core Tensor
maximum number of iterations if error stays above
relative Frobenius norm error tolerance
This function is an extension of the
Uses the Alternating Least Squares (ALS) estimation procedure also known as Higher-Order Orthogonal Iteration (HOOI). Intialized using a (Truncated-)HOSVD. A progress bar is included to help monitor operations on large tensors.
a list containing the following:
the core tensor, with modes specified by
a list of orthgonal factor matrices - one for each mode,
with the number of columns of the matrices given by
whether or not
by the last iteration
darr after compression
the percent of Frobenius norm explained by the approximation
the Frobenius norm of the error
vector containing the Frobenius norm of error for all the iterations
The length of
ranks must match
T. Kolda, B. Bader, "Tensor decomposition and applications". SIAM Applied Mathematics and Applications 2009.
library("DelayedRandomArray") darr <- RandomUnifArray(c(2,3,4)) tucker(darr, ranks=c(1,2,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.