wrap.correlation {Riemann}R Documentation

Prepare Data on Correlation Manifold

Description

The collection of correlation matrices is considered as a subset (and quotient) of the well-known SPD manifold. In our package, it is defined as

C++p={XRp×p  X=X, rank(X)=p, diag(X)=1}\mathcal{C}_{++}^p = \lbrace X \in \mathbf{R}^{p\times p} ~\vert~ X^\top = X,~ \textrm{rank}(X)=p,~ \textrm{diag}(X) = 1 \rbrace

where the rank condition means it is strictly positive definite. Please note that the geometry involving semi-definite correlation matrices is not the objective here.

Usage

wrap.correlation(input)

Arguments

input

correlation data matrices to be wrapped as riemdata class. Following inputs are considered,

array

an (p×p×n)(p\times p\times n) array where each slice along 3rd dimension is a correlation matrix.

list

a length-nn list whose elements are (p×p)(p\times p) correlation matrices.

Value

a named riemdata S3 object containing

data

a list of (p×p)(p\times p) correlation matrices.

size

size of each correlation matrix.

name

name of the manifold of interests, "correlation"

Examples

#-------------------------------------------------------------------
#                 Checker for Two Types of Inputs
#
#  5 observations; empirical correlation of normal observations.
#-------------------------------------------------------------------
#  Data Generation
d1 = array(0,c(3,3,5))
d2 = list()
for (i in 1:5){
  dat = matrix(rnorm(10*3),ncol=3)
  d1[,,i] = stats::cor(dat)
  d2[[i]] = d1[,,i]
}

#  Run
test1 = wrap.correlation(d1)
test2 = wrap.correlation(d2)


[Package Riemann version 0.1.4 Index]