Skip to contents

Checks 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.

Usage

is_valid_grassmann(X, p, n, k)

Arguments

X

A matrix or data frame of Grassmann data; rows are samples, with n * k columns (see manifold_grassmann).

p

The base point: a vector of length n * k or an n x k matrix 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)