Learn R Programming

tensorBSS (version 0.3.9)

tPCA: PCA for Tensor-Valued Observations

Description

Computes the tensorial principal components.

Usage

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

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.

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.

Author

Joni Virta

Details

The observed tensors (array) \(X\) of size \(p_1 \times p_2 \times \ldots \times 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 \times d_2 \times \ldots \times d_r\). In R the sample of \(X\) is saved as an array of dimensions \(p_1, p_2, \ldots, p_r, N\).

References

Virta, J., Taskinen, S. and Nordhausen, K. (2016), Applying fully tensorial ICA to fMRI data, Signal Processing in Medicine and Biology Symposium (SPMB), 2016 IEEE,
tools:::Rd_expr_doi("10.1109/SPMB.2016.7846858")

Examples

Run this code
# Digit data example

data(zip.train)
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)

Run the code above in your browser using DataLab