Bundles everything the package needs to know about a manifold into a
single object. manifold.dcov.test and
choose_base_point only interact with the manifold through
this object, so supporting a new manifold amounts to writing these
functions (conventionally in a script R/manifold-<name>.R, with names
ending in _<name>) and registering the resulting constructor in
get_manifold. See manifold_torus for an
example.
Arguments
- name
Character string identifying the manifold, e.g.
"torus".- representation
Character string describing how points of the manifold are represented as matrix rows (e.g.
"[0,1)^d"); used in error messages.- contains
Function
f(X)returningTRUEif every row of the matrixXis a point of the manifold in the expected representation,FALSEotherwise.- log_map
Function
f(X, p)mapping each row ofXto the tangent space at base pointpvia the logarithmic (inverse exponential) map. Must return a numeric matrix with one row per row ofX.- dist
Function
f(X, p)returning the numeric vector of geodesic distances between each row ofXand the pointp.- is_valid
Function
f(X, p)returningTRUEif no row ofXlies on the cut locus ofp(where the log map is undefined),FALSEotherwise. It should stop with an error ifpis malformed (e.g. wrong length).- base_point
Named list of base point selection methods. Each element is a function
f(X, n_start, maxit, seed, ...)returning a list with elementsp(the chosen base point) andconvergence(an optimizer convergence code, orNAfor non-iterative methods); arguments it does not need are absorbed by.... The first element is the default method. A data-centered method can be built fromdistwith the genericoptimize_base_point.
Examples
m <- manifold_torus()
m$name
#> [1] "torus"
names(m$base_point)
#> [1] "auto" "optimize"
