| wrap.spd | R Documentation |
The collection of symmetric positive-definite matrices is a well-known example of matrix manifold. It is defined as
\mathcal{S}_{++}^p = \lbrace X \in \mathbf{R}^{p\times p} ~\vert~ X^\top = X,~ \textrm{rank}(X)=p \rbrace
where the rank condition means it is strictly positive definite. Please note that
the geometry involving semi-definite matrices is considered in wrap.spdk.
wrap.spd(input)
input |
SPD data matrices to be wrapped as
|
a named riemdata S3 object containing
a list of (p\times p) SPD matrices.
size of each SPD matrix.
name of the manifold of interests, "spd"
#-------------------------------------------------------------------
# Checker for Two Types of Inputs
#
# Generate 5 observations; empirical covariance 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::cov(dat)
d2[[i]] = d1[,,i]
}
# Run
test1 = wrap.spd(d1)
test2 = wrap.spd(d2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.