tensorTransform {tensorBSS} | R Documentation |
Linear Transformation of Tensors from mth Mode
Description
Applies a linear transformation to the mth mode of each individual tensor in an array of tensors.
Usage
tensorTransform(x, A, m)
Arguments
x |
Array of an order at least two with the last dimension corresponding to the sampling units. |
A |
Matrix corresponding to the desired linear transformation with the number of columns equal to the size of the |
m |
The mode from which the linear transform is to be applied. |
Details
Applies the linear transformation given by the matrix of size
to the
th mode of each of the
observed tensors
in the given
-dimensional array
x
. This is equivalent to separately applying the linear transformation given by to each
-mode vector of each
.
Value
Array of size
Author(s)
Joni Virta
Examples
# Generate sample data.
n <- 10
x <- t(cbind(rnorm(n, mean = 0),
rnorm(n, mean = 1),
rnorm(n, mean = 2),
rnorm(n, mean = 3),
rnorm(n, mean = 4),
rnorm(n, mean = 5)))
dim(x) <- c(3, 2, n)
# Transform from the second mode
A <- matrix(c(2, 1, 0, 3), 2, 2)
z <- tensorTransform(x, A, 2)
# Compare
z[, , 1]
x[, , 1]%*%t(A)
[Package tensorBSS version 0.3.8 Index]