View source: R/wrap05grassmann.R
wrap.grassmann | R Documentation |
Grassmann manifold Gr(k,p) is the set of k-planes, or k-dimensional subspaces in R^p, which means that for a given matrix Y \in \mathbf{R}{p\times k}, the column space SPAN(Y) is an element in Grassmann manifold. We use a convention that each element in Gr(k,p) is represented as an orthonormal basis (ONB) X \in \mathbf{R}^{p\times k} where
X^\top X = I_k.
If not provided in such a form, this wrapper takes a QR decomposition of the given data to recover a corresponding ONB.
wrap.grassmann(input)
input |
data matrices to be wrapped as
|
a named riemdata
S3 object containing
a list of k-subspace basis matrices.
size of each k-subspace basis matrix.
name of the manifold of interests, "grassmann"
#------------------------------------------------------------------- # Checker for Two Types of Inputs # # Generate 5 observations in Gr(2,4) #------------------------------------------------------------------- # Generation d1 = array(0,c(4,2,5)) d2 = list() for (i in 1:5){ d1[,,i] = matrix(rnorm(4*2), ncol=2) d2[[i]] = d1[,,i] } # Run test1 = wrap.grassmann(d1) test2 = wrap.grassmann(d2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.