tensorStandardize {tensorBSS}R Documentation

Standardize an Observation Array

Description

Standardizes an array of array-valued observations simultaneously from each mode. The method can be seen as a higher-order analogy for the regular multivariate standardization of random vectors.

Usage

tensorStandardize(x, location = NULL, scatter = NULL)

Arguments

x

Array of an order higher than two with the last dimension corresponding to the sampling units.

location

The location to be used in the standardizing. Either NULL, defaulting to the mean array, or a user-specified p_1 \times p_2 \times \ldots \times p_r-dimensional array.

scatter

The scatter matrices to be used in the standardizing. Either NULL, defaulting to the m-mode covariance matrices, or a user-specified list of length r of p_1 \times p_1, \ldots , p_r \times p_r-dimensional symmetric positive definite matrices.

Details

The algorithm first centers the n observed tensors X_i using location (either the sample mean, or a user-specified location). Then, if scatter = NULL, it estimates the mth mode covariance matrix Cov_m(X) = E(X^{(m)} X^{(m)T})/(p_1 \ldots p_{m-1} p_{m+1} \ldots p_r), where X^{(m)} is the centered m-flattening of X, for each mode, and transforms the observations with the inverse square roots of the covariance matrices from the corresponding modes. If, instead, the user has specified a non-NULL value for scatter, the inverse square roots of those matrices are used to transform the centered data.

Value

A list containing the following components:

x

Array of the same size as x containing the standardized observations. The used location and scatters are returned as attributes "location" and "scatter".

S

List containing inverse square roots of the covariance matrices of different modes.

Author(s)

Joni Virta

Examples

# Generate sample data.
n <- 100
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)

# Standardize
z <- tensorStandardize(x)$x

# The m-mode covariance matrices of the standardized tensors
mModeCovariance(z, 1)
mModeCovariance(z, 2)

[Package tensorBSS version 0.3.8 Index]