Expand description
User-selectable response geometries beyond Sphere and Simplex.
The fit DSL exposes response_geometry="...": one scalar Gaussian GAM is
fitted per tangent coordinate at a fixed base point (the intrinsic Fréchet
mean when none is supplied), and predictions are mapped back to the manifold
by the exponential map. Sphere and Simplex have bespoke batched wrappers in
their own modules; this module supplies the same (values 2-D, base 1-D) → tangent 2-D / (tangent 2-D, base 1-D) → values 2-D contract for the
curved matrix manifolds whose per-point math is already wired in
[crate::geometry] but which were never reachable as a fittable response
geometry: the SPD cone Sym⁺(n), the Grassmannian Gr(k, n), the Stiefel
manifold St(k, n), and the Poincaré ball B^d_κ.
Every primitive here delegates to the canonical landed math
(RiemannianManifold::exp_map/log_map and
the Poincaré exp_map/log_map);
the only new code is the batched row loop, the base-point dimension wiring,
and a generic Riemannian Karcher (Fréchet) mean shared by all four. There is
no separate per-manifold mean: the SPD safeguarded Karcher iteration is
generalised once, over the metric supplied by
RiemannianManifold::metric_tensor, so adding a curved response geometry
is a single resolver arm.
Structs§
- Response
Curvature Fit - Outcome of fitting curvature as an estimand on a constant-curvature response geometry: the optimised κ̂, its tangent base point, the profile-likelihood CI, and the interior-point flatness (Wilks) test of κ = 0.
Enums§
- Response
Manifold - A fittable curved response geometry. Each variant carries the shape the user
requested; the embedding/ambient flat dimension is fixed by that shape and
is the column count of the
valuesmatrix the caller supplies.
Functions§
- dispatch_
exp_ map - String-driven response-geometry exponential map: inverse of
dispatch_log_mapgiven an explicit base point. - dispatch_
log_ map - String-driven response-geometry log map: parse the user
label(with shape inference from the response column count), pick the base point (intrinsic Fréchet mean whenbaseisNone), map every row to its tangent, and report the canonical resolved label. This is the curved-manifold analogue of the sphere/simplex dispatch and the single entry the FFI calls for these geometries. - fit_
response_ curvature - Fit curvature as an estimand on a constant-curvature response geometry.
- response_
curvature_ criterion - Profiled curvature criterion
V_p(κ)for the constant-curvature response geometry: the σ-profiled HONEST change-of-variables negative log-likelihood of the observed chart coordinatesy_iat curvatureκ, expressed w.r.t. ambient Lebesgue measuredy. Lower is better (κ̂ = argmin). Returns(V_p, base); the base point is the κ-INDEPENDENT flat centroid (the tangent expansion point that the scalar GAMs are fitted around), held fixed across κ so the estimate is not re-entangled with the chart scale. - response_
exp_ map - Batched response-geometry exponential: map predicted tangent coordinates
back to manifold-valued responses at
base. Inverse ofresponse_log_mapwith the same shapes. - response_
frechet_ mean - Intrinsic (Karcher) Fréchet mean of manifold-valued responses, the default
base point when the user supplies none.
valuesis(n_rows, ambient). - response_
log_ map - Batched response-geometry logarithm: map every manifold-valued response row
to its tangent coordinate at
base.valuesis(n_rows, ambient),baseis(ambient,), and the returned tangent is(n_rows, ambient)(the same flat ambient layout — the tangent of a matrix manifold is itself a flattened matrix). The scalar Gaussian GAMs the caller fits operate column-wise on this matrix exactly as they do for the sphere. - response_
projection_ residual - Per-row extrinsic distance from ambient observations to a candidate response geometry — a coordinate-dependent constraint / closure-distance diagnostic.