PCA for Tensor-Valued Observations

Description

Computes the tensorial principal components.

Usage

1
tPCA(x, p = NULL, d = NULL)

Arguments

x

Numeric array of an order at least three. It is assumed that the last dimension corresponds to the sampling units.

p

A vector of the percentages of variation per each mode the principal components should explain.

d

A vector of the exact number of components retained per each mode. At most one of this and the previous argument should be supplied.

Details

The observed tensors (array) X of size p_1 x p_2 x ... x p_r measured on N units are projected from each mode on the eigenspaces of the m-mode covariance matrices of the corresponding modes. As in regular PCA, by retaining only some subsets of these projections (indices) with respective sizes d_1, d_2, ... d_r, a dimension reduction can be carried out, resulting into observations tensors of size d_1 x d_2 x ... x d_r. In R the sample of X is saved as an array of dimensions p_1, p_2, ..., p_r, N.

Value

A list containing the following components:

S

Array of the same size as x containing the principal components.

U

List containing the rotation matrices

D

List containing the amounts of variance explained by each index in each mode.

p_comp

The percentages of variation per each mode that the principal components explain.

Xmu

The data location.

Author(s)

Joni Virta

References

Virta, J., Taskinen, S. and Nordhausen, K. (2016), Applying fully tensorial ICA to fMRI data, manuscript under preparation, ???, ???–???.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Digit data example

library(ElemStatLearn)
x <- zip.train

rows <- which(x[, 1] == 0 | x[, 1] == 1)
x0 <- x[rows, 2:257]
y0 <- x[rows, 1] + 1

x0 <- t(x0)
dim(x0) <- c(16, 16, 2199)


tpca <- tPCA(x0, d = c(2, 2))
pairs(t(apply(tpca$S, 3, c)), col=y0)