Skip to main content

Module frechet

Module frechet 

Source
Expand description

Fréchet / object-data regression and statistics (FRE-01).

Metric-space (object-data) regression and statistics in the style of the R frechet package: a MetricSpace abstraction (distance + weighted-Fréchet- mean solver) with a 1D-Wasserstein (density-response) backend (WassersteinDensitySpace) as the first concrete space, the sample Fréchet frechet_mean / frechet_variance, the 1D 2-Wasserstein distance (wasserstein2_distance), global and local (kernel-weighted) Fréchet regression over Euclidean predictors, density-response regression, and a Fréchet ANOVA group-difference test.

§R baselines

  • Global / local Fréchet regression — frechet::GloWassReg / LocWassReg (Petersen & Müller 2019, Annals of Statistics 47(2)).
  • Fréchet ANOVA — frechet::DenANOVA (Dubey & Müller 2019, Biometrika 106(4)).

§Reuse & conventions

The density backend reuses DENS-01’s quantile/Wasserstein machinery (crate::density_fda) rather than re-deriving it. All public functions return Result<_, FdarError> and validate inputs at entry (never panic). Any permutation path uses per-thread seeded RNG (StdRng::seed_from_u64(seed + k)) with a default of 999 replications. Result structs derive Debug, Clone, PartialEq and are serde-gated.

§Divergence

Global/local Fréchet regression weights can be negative; where R uses an osqp quadratic program to enforce a monotone predicted quantile, this crate uses a zero-dependency sort-based isotonic projection (see the regression submodule).

Structs§

CorrelationMatrixSpace
Correlation-matrix response space (FRE-02-02).
FrechetAnovaResult
Result of a Fréchet ANOVA group-difference test (frechet_anova).
FrechetGlobalRegResult
Result of global Fréchet regression (frechet_global_reg).
FrechetLocalRegResult
Result of local (local-linear, kernel-weighted) Fréchet regression (frechet_local_reg).
NetworkSpace
Network response space over d-node graph Laplacians (FRE-02-04).
PointProcessSpace
Point-process response space over length-m intensity/count vectors (FRE-02-05).
SpdMatrixSpace
SPD covariance-matrix response space (FRE-02-01).
SphericalSpace
Spherical-data response space on Sᵈ⁻¹ (FRE-02-03).
WassersteinDensitySpace
The 1D-Wasserstein (density-response) metric space.

Enums§

SpdMetric
The metric used by an SpdMatrixSpace.

Traits§

MetricSpace
A metric space: a distance function plus a weighted-Fréchet-mean solver over its objects. Regression / statistics routines are generic over this trait.

Functions§

frechet_anova
Fréchet ANOVA group-difference test on metric-space (density) responses.
frechet_anova_space
Fréchet ANOVA group-difference test over an arbitrary object MetricSpace backend (FRE-02-07). Reuses the Dubey–Müller [compute_tn_generic] statistic and the identical seeded-permutation p-value machinery as frechet_anova, generalized from densities to any metric-space objects.
frechet_global_reg
Global Fréchet regression with Euclidean predictors (Petersen & Müller 2019).
frechet_global_reg_space
Global Fréchet regression over an arbitrary object MetricSpace backend (FRE-02-06). Reuses the Petersen–Müller [compute_global_weights] and predicts one object per xout row via the space’s weighted Fréchet mean.
frechet_local_reg
Local (local-linear, Gaussian-kernel-weighted) Fréchet regression (Petersen & Müller 2019, frechet::LocWassReg).
frechet_local_reg_space
Local (local-linear, kernel-weighted) Fréchet regression over an arbitrary object MetricSpace backend (FRE-02-06). Reuses [compute_local_weights] and predicts one object per xout row via the space’s weighted Fréchet mean.
frechet_mean
Fréchet mean (weighted barycenter) of a sample of metric-space objects.
frechet_variance
Fréchet variance: the (weighted) mean squared distance to a given Fréchet mean.
wasserstein2_distance
The 1D 2-Wasserstein distance between two densities on a shared grid.