Learn R Programming

tensr (version 1.0.1)

hooi: Calculate the higher-order orthogonal iteration (HOOI).

Description

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.

Usage

hooi(X, r, tol = 10^-6, print_fnorm = FALSE, itermax = 500)

Arguments

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.

Value

G An all-orthogonal core array.

U A vector of matrices with orthonormal columns.

Details

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

References

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.

Examples

Run this code
# NOT RUN {
## 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)
# }

Run the code above in your browser using DataLab