View source: R/mModeCovariance.R
mModeCovariance | R Documentation |
Estimates the m-mode covariance matrix from an array of array-valued observations.
mModeCovariance(x, m, center = TRUE, normalize = TRUE)
x |
Array of order higher than two with the last dimension corresponding to the sampling units. |
m |
The mode with respect to which the covariance matrix is to be computed. |
center |
Logical, indicating whether the observations should be centered prior to computing the covariance matrix. Default is |
normalize |
Logical, indicating whether the resulting matrix is divided by |
The m-mode covariance matrix provides a higher order analogy for the ordinary covariance matrix of a random vector and is computed for a random tensor X
of size p_1 \times p_2 \times \ldots \times p_r
as 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
. The algorithm computes the estimate of this based on the sample x
.
The m
-mode covariance matrix of x
having the size p_m \times p_m
.
Joni Virta
Virta, J., Li, B., Nordhausen, K. and Oja, H., (2017), Independent component analysis for tensor-valued data, Journal of Multivariate Analysis, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jmva.2017.09.008")}
mModeAutoCovariance
## 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)
# The m-mode covariance matrices of the first and second modes
mModeCovariance(x, 1)
mModeCovariance(x, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.