tensr, Because tensor was Already Taken

CRAN Version License: GPL v3 R-CMD-check

Description

This package contains a collection of functions for statistical analysis with tensor(array)-variate data sets.

Let \(X\) be a multidimensional array (also called a tensor) of \(K\) dimensions. This package provides a series of functions to perform statistical inference when \(\text{vec}(X) \sim N(0,\Sigma)\), where \(\Sigma\) is assumed to be Kronecker structured. That is, \(\Sigma\) is the Kronecker product of \(K\) covariance matrices, each of which has the interpretation of being the covariance of \(X\) along its \(k\)th mode, or dimension.

Pay particular attention to the zero mean assumption. That is, you need to de-mean your data prior to applying these functions. If you have more than one sample, \(X_i\) for \(i = 1,\ldots,n\), then you can concatenate these tensors along a \((K+1)\)th mode to form a new tensor \(Y\) and apply the demean_tensor() function to \(Y\) which will return a tensor that satisfies the mean-zero assumption.

Details of the methods may be found in Gerard & Hoff (2015) and Gerard & Hoff (2016). In particular, tensr has the following features:

This package is also published on CRAN.

Vignettes are available on Equivariant Inference and Likelihood Inference.

Installation

To install from CRAN, run in R:

install.packages("tensr")

To install the latest version from Github, run in R:

## install.packages("pak")
pak::pak("github::dcgerard/tensr")

References

Gerard, D., & Hoff, P. (2016). A higher-order LQ decomposition for separable covariance models. Linear Algebra and its Applications, 505, 57-84. doi: 10.1016/j.laa.2016.04.033

Gerard, D., & Hoff, P. (2015). Equivariant minimax dominators of the MLE in the array normal model. Journal of Multivariate Analysis, 137, 32-49. doi: 10.1016/j.jmva.2015.01.020