Tensor analogue of PCA introduced by Mor et al. (2022) based on Kilmer's m-product algebra and tsvdm.

tpca(
  x,
  ncomp = NULL,
  m = NULL,
  minv = NULL,
  center = TRUE,
  matrix_output = TRUE,
  bpparam = NULL
)

Arguments

x

Tensor input.

ncomp

The estimated number of components. ncomp can be explicitly set using an integer value, 0 < float value < 1, or left as NULL which will default to the maximum ncomp value possible.

m

A function which applies an orthogonal tensor tubal transform.

minv

The inverse of m.

center

If set to false, the data tensor will not be centered into Mean Deviation Form (see Mor et al. 2022). By default, the mean horizontal slice of the input tensor(s) are subtracted, so that all of the horizontal slices sum to 0, analgous to centering matrix data.

matrix_output

Collect the top singular vectors across the tensor, organized by the magnitude of the corresponding singular vector, and place them into the columns of a matrix. Corresponds to the 'matrix compression' type of scheme described in Mor et al. 2022.

bpparam

A BiocParallelParam-class object indicating the type of parallelisation. Does not have any effect if transform functions explicitly set using m, minv.

Value

A list containing:

ncomp

The number of components used.

x

The centered input tensor.

loadings

The loadings matrix or tensor.

variates

The projected data in the reduced space.

Author

Brendan Lu