View source: R/wrap03correlation.R
wrap.correlation | R Documentation |
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
\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.
wrap.correlation(input)
input |
correlation data matrices to be wrapped as
|
a named riemdata
S3 object containing
a list of (p\times p) correlation matrices.
size of each correlation matrix.
name of the manifold of interests, "correlation"
#------------------------------------------------------------------- # 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.