frechet: Statistical Analysis for Random Objects and Non-Euclidean Data

Yaqing Chen, Yidong Zhou, Han Chen, Álvaro Gajardo, Jianing Fan, Qixian Zhong, Paromita Dubey, Kyunghee Han, Satarupa Bhattacharjee, Petersen Alexander, Hans-Georg MüllerOpenalex Unknown 2020 · OpenAlex

Abstract

The frechet R package provides a robust statistical framework for analyzing "random objects"—complex data types like probability distributions, networks, and covariance matrices that do not live in standard linear spaces. By implementing Fréchet regression and associated tools, it allows researchers to model how these non-Euclidean responses change in relation to standard numerical predictors. The package supports various metric spaces, including 2-Wasserstein space for distributions and power metrics for covariance matrices.

Introduction

Most classical statistical methods assume that data points exist in Euclidean space, where arithmetic operations like addition and subtraction are straightforward. However, modern data often consists of "objects" where these rules break down. For example, brain connectivity networks or population age distributions cannot be simply averaged using standard arithmetic without violating their intrinsic constraints (e.g., a covariance matrix must remain positive definite).

The frechet package addresses this gap by providing a suite of tools—regression, ANOVA, and change-point detection—specifically designed to respect the geometry of these complex metric spaces. It implements the theoretical foundations established by Petersen and Müller (2019), offering a unified framework for non-Euclidean data analysis.

The Fréchet Regression Framework

The core of the package is Fréchet regression, which generalizes the concept of a linear model to cases where the response is an element of a metric space.

Fréchet Mean and Regression Models

Instead of a standard arithmetic mean, the package uses the Fréchet mean, defined as the point in a metric space that minimizes the sum of squared distances to all other points in a sample. Building on this, the package offers:

  • Global Regression: Useful for capturing overall trends across the data range.
  • Local Regression: Employs kernel-based models for non-parametric estimation, allowing for non-linear relationships between predictors and the object.

Specialized Metrics and Covariance Analysis

The package implements specific support for various metrics to suit different data types, such as the $L^2$-Wasserstein distance for probability densities and Geodesic distance for spherical data. For covariance and correlation matrices, it supports Frobenius, Power, and Cholesky metrics.

Generalized Fréchet integrals of covariance matrix

As shown in the documentation for CovFIntegral, the package provides specialized functions to handle complex operations like Fréchet integrals for covariance matrices, ensuring that the resulting objects maintain their mathematical properties throughout the analysis.

Implementation and Key Results

The frechet package utilizes specialized solvers (via osqp and quadprog) and C++ integration (Rcpp) to handle the optimization problems required to find Fréchet means in complex spaces efficiently.

Visualization and Statistical Inference

A key strength of the package is its ability to make complex results interpretable through visualization. Functions like CreateCovRegPlot and plot.denReg allow researchers to visualize how complex objects evolve across the range of a predictor.

Arguments for the color.bar visualization utility

Utilities such as color.bar (parameters shown above) facilitate these visualization efforts, allowing for clear mapping of variable values to color scales in complex plots. Beyond simple estimation, the package includes DenANOVA and NetANOVA for comparing groups of objects, and DenCPD and NetCPD for detecting structural changes in a sequence of objects (change-point detection), providing p-values through bootstrap and asymptotic methods.

Conclusion

The frechet package provides a comprehensive implementation of Fréchet statistics, allowing researchers to treat networks, densities, and matrices under a single mathematical umbrella. While the current implementation focuses on Euclidean predictors, it provides the necessary foundation for advanced non-Euclidean data analysis. The results are highly sensitive to the choice of metric, placing the burden of choosing the most "scientifically meaningful" distance on the researcher, but providing the tools to execute that choice rigorously.

Summary updated

BibTeX
@inproceedings{chen2020frechet,
  author = {Yaqing Chen and Yidong Zhou and Han Chen and Álvaro Gajardo and Jianing Fan and Qixian Zhong and Paromita Dubey and Kyunghee Han and Satarupa Bhattacharjee and Petersen Alexander and Hans-Georg Müller},
  title = {{frechet: Statistical Analysis for Random Objects and Non-Euclidean Data}},
  booktitle = {Openalex Unknown},
  year = {2020},
  doi = {10.32614/cran.package.frechet},
}
Figure