onmanifold: Manifold check and projection

Description Usage Arguments Value Author(s) Examples

View source: R/GeodRegr.R

Description

Checks whether each data point in y is on the given manifold, and if not, provides a modified version of y where each column has been projected onto the manifold.

Usage

1
onmanifold(manifold, y)

Arguments

manifold

Type of manifold ('euclidean', 'sphere', 'hyperbolic', or 'kendall').

y

A vector, matrix, or data frame whose columns should represent points on the manifold.

Value

A named list containing

on

a logical vector describing whether or not each column of y is on the manifold.

data

a matrix of data frame of the same dimensions as y; each column of y has been projected onto the manifold.

Author(s)

Ha-Young Shin

Examples

1
2
3
4
5
6
7
8
9
y1 <- matrix(rnorm(10), ncol = 2)
y1 <- y1[, 1] + (1i) * y1[, 2]
y2 <- matrix(rnorm(10), ncol = 2)
y2 <- y2[, 1] + (1i) * y2[, 2]
y3 <- matrix(rnorm(10), ncol = 2)
y3 <- y3[, 1] + (1i) * y3[, 2]
y3 <- (y3 - mean(y3)) / norm(y3 - mean(y3), type = '2') # project onto preshape space
y <- matrix(c(y1, y2, y3), ncol = 3)
onmanifold('kendall', y)

GeodRegr documentation built on Sept. 5, 2021, 5:17 p.m.