Finds a base point p on the manifold for X, using one of
the base point methods provided by the manifold (see
new_manifold), then validates it with the manifold's
cut-locus check (is_valid). For the torus
(manifold_torus) the methods are:
"auto"(the default): the closed-form, per-coordinate maximal-gap method (auto_base_point_torus), which is not centered on the data, but is guaranteed to avoid the cut locus ofXby construction, and is much cheaper to compute."optimize": numerically minimizes the total torus distance frompto every row ofX(a geometric-median-style, data-centered point), via multi-startoptim(optimize_base_point_torus). Cut-locus avoidance is checked afterward, not guaranteed by construction.
For hyperbolic space (manifold_hyperbolic), "auto"
is the Lorentzian centroid (auto_base_point_hyperbolic) and
"optimize" minimizes the total hyperbolic distance
(optimize_base_point_hyperbolic); there is no cut locus.
For the Grassmann manifold (manifold_grassmann),
"auto" is the projection mean
(auto_base_point_grassmann) and "optimize" minimizes
the total Grassmann distance
(optimize_base_point_grassmann).
Usage
choose_base_point(
X,
manifold = "torus",
method = NULL,
n_start = 10,
maxit = 200,
seed = 42
)Arguments
- X
A matrix or data frame of manifold data; rows are samples, columns are coordinates.
- manifold
The manifold
Xlies on: a name accepted byget_manifold("torus", the default, or"hyperbolic") or a manifold object, such asmanifold_grassmann(n, k).- method
Name of one of the manifold's base point methods. If
NULL(the default), the manifold's first (default) method is used, i.e."auto"for the torus.- n_start
Number of random restarts for iterative methods (e.g.
"optimize"), used to avoid local minima of the objective. Defaults to 10. Ignored by methods that do not use it.- maxit
Maximum number of
optimiterations per restart, for iterative methods. Defaults to 200. Ignored by methods that do not use it.- seed
Integer random seed for iterative methods. Defaults to 42. Ignored by methods that do not use it.
Value
A list with three elements:
- p
The chosen base point.
- value
The total geodesic distance from
pto every row ofX, computed with the manifold'sdistfor every method so they are comparable. Lower meanspis more central.- convergence
For iterative methods, the
optimconvergence code of the best restart (0indicates successful convergence).NAfor non-iterative methods such as"auto".
Stops with an error if the chosen p happens to land on the cut
locus of some row of X: for method = "optimize" this
suggests a higher n_start, while for the torus method =
"auto" it should not happen (up to floating-point tolerance) and
indicates degenerate data.
