Skip to content

expose alternative Minkowski metrics for the plane #47

@corybrunson

Description

@corybrunson

The current R bindings use the parameter p to specify the cost function on the vector of distances between matched pairs. However, Hera also (though less clearly) allows the user to specify the power of the Minkowski metric used to measure these distances in the plane; in some manuscripts this is denoted $q$, though in the Hera paper the roles are reversed.

The C++ and R code should be (minimally) enhanced to allow the user to specify the "internal" Minkowski metric on the plane as well as the "Wasserstein power" on the vector of distances. Theoretical work has focused on this full two-parameter family and many applications may benefit from having both parameters available, for example tuning of clustering models.

Experiments on my machine suggest that the Wasserstein distance can be extended by simply adding the internal_p parameter to the {cpp11}-registered function wassersteinDistance(), which would then pass it to wassersteinDist(). However, these functions don't allow internal_p = hera::get_infinity<double>(), and extending bottleneckDistance() looks to be more challenging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions