ttv: Tensor times vector calculation In MFPCA: Multivariate Functional Principal Component Analysis for Data Observed on Different Dimensional Domains

Description

Functionality adapted from the MATLAB tensor toolbox (http://www.sandia.gov/~tgkolda/TensorToolbox/index-2.6.html).

Usage

 1 ttv(A, v, dim)

Arguments

 A An array. v A list of the same length as dim. dim A vector specifying the dimensions for the multiplication.

Details

Let A be a tensor with dimensions d_1 x d_2 x … x d_p and let v be a vector of length d_i. Then the tensor-vector-product along the i-th dimension is defined as

B[j_1, … ,j_{i-1},j_{i+1},…,j_d] = ∑ A[j_1, …, j_{i-1}, i, j_{i+1}, …, j_d] v[i].

It can hence be seen as a generalization of the matrix-vector product.

The tensor-vector-product along several dimensions between a tensor A and multiple vectors v_1,...,v_k (k ≤ p) is defined as a series of consecutive tensor-vector-product along the different dimensions. For consistency, the multiplications are calculated from the dimension of the highest order to the lowest.

Value

An array, the result of the multiplication.

References

B. W. Bader and T. G. Kolda. Algorithm 862: MATLAB tensor classes for fast algorithm prototyping, ACM Transactions on Mathematical Software 32(4):635-653, December 2006.