
Check whether a base point is valid for a Grassmann data set.
Source:R/manifold-grassmann.R
is_valid_grassmann.RdChecks that p represents a point of \(Gr(n, k)\), and warns if
any row of X lies on the cut locus of p, i.e. has a
principal angle of \(\pi/2\) with it (the smallest singular value of
\(U_0^T U\) is zero), where the logarithm is not unique.
Arguments
- X
A matrix or data frame of Grassmann data; rows are samples, with
n * kcolumns (seemanifold_grassmann).- p
The base point: a vector of length
n * kor annxkmatrix with orthonormal columns.- n
Integer: dimension of the ambient space.
- k
Integer: dimension of the subspaces,
1 <= k <= n - 1.
Value
Logical: TRUE if no row of X falls on the cut locus
of p, FALSE otherwise. Stops with an error if p
has the wrong length or non-orthonormal columns.
Examples
U0 <- diag(4)[, 1:2]
X <- exp_map_grassmann(matrix(rnorm(40, sd = 0.3), nrow = 10), U0)
is_valid_grassmann(X, U0, n = 4, k = 2)