# mModeAutoCovariance: The m-Mode Autocovariance Matrix In tensorBSS: Blind Source Separation Methods for Tensor-Valued Observations

## Description

Estimates the m-mode autocovariance matrix from an array of array-valued observations with the specified lag.

## Usage

 `1` ```mModeAutoCovariance(x, m, lag, center = TRUE) ```

## Arguments

 `x` Array of order higher than two with the last dimension corresponding to the sampling units. `m` The mode with respect to which the autocovariance matrix is to be computed. `lag` The lag with respect to which the autocovariance matrix is to be computed. `center` Logical, indicating whether the observations should be centered prior to computing the autocovariance matrix. Default is `TRUE`.

## Details

The m-mode autocovariance matrix provides a higher order analogy for the ordinary autocovariance matrix of a random vector and is computed for a random tensor X_t of size p_1 x p_2 x ... x p_r as Cov_m,tau(X_t) = E(X_t(m) X_(t+tau)(m)^T)/(p_1 ... p_(m-1) p_(m+1) ... p_r), where X_t(m) is the centered m-flattening of X_t and tau is the desired `lag`. The algorithm computes the estimate of this based on the sample `x`.

## Value

The `m`-mode autocovariance matrix of `x` with respect to `lag` having the size p_m x p_m.

Joni Virta

## References

Virta, J. and Nordhausen, K., (2016), Blind source separation of tensor-valued time series, submitted, ???, ???–???.

`mModeCovariance`
 ``` 1 2 3 4 5 6 7 8 9 10 11``` ```n <- 1000 S <- t(cbind(as.vector(arima.sim(n = n, list(ar = 0.9))), as.vector(arima.sim(n = n, list(ar = -0.9))), as.vector(arima.sim(n = n, list(ma = c(0.5, -0.5)))), as.vector(arima.sim(n = n, list(ar = c(-0.5, -0.3)))), as.vector(arima.sim(n = n, list(ar = c(0.5, -0.3, 0.1, -0.1), ma=c(0.7, -0.3)))), as.vector(arima.sim(n = n, list(ar = c(-0.7, 0.1), ma = c(0.9, 0.3, 0.1, -0.1)))))) dim(S) <- c(3, 2, n) mModeAutoCovariance(S, m = 1, lag = 1) mModeAutoCovariance(S, m = 1, lag = 4) ```