Mallows_dist: Mallows Distance

View source: R/int_distances.r

Mallows_distR Documentation

Mallows Distance

Description

Calculate the squared Mallows distance between all rows in data and the barycenter.

Usage

Mallows_dist(data, mean_c = NULL, mean_r = NULL, mean = NULL)

Arguments

data

An intData object containing the macrodata/interval data

mean_c

(Optional) A vector specifying the mean of centers. Defaults to NULL, in which case it will be computed using the sample mean of centers.

mean_r

(Optional) A vector specifying the mean of ranges Defaults to NULL, in which case it will be computed using the sample mean of ranges.

mean

(Optional) An intData object containing the barycenter of the data. If provided, it will override mean_c and mean_r.

Details

The squared Mallows distance is defined according to the LatentCase:

  • "U_id_symmetric": The latent variables are identically distributed and symmetric:

    d_\mathrm{M}(\boldsymbol{x})^2=(\boldsymbol{c}-\boldsymbol{\mu}_C)^{\top}(\boldsymbol{c}-\boldsymbol{\mu}_C)+\delta(\boldsymbol{r}-\boldsymbol{\mu}_R)^{\top}(\boldsymbol{r}-\boldsymbol{\mu}_R),

    where \delta=\mathbb{E}(U^2)/4 is the parameter of the latent variables.

  • "U_id": The latent variables are identically distributed:

    d_\mathrm{M}(\boldsymbol{x})^2=(\boldsymbol{c}-\boldsymbol{\mu}_C)^{\top}(\boldsymbol{c}-\boldsymbol{\mu}_C)+\delta(\boldsymbol{r}-\boldsymbol{\mu}_R)^{\top}(\boldsymbol{r}-\boldsymbol{\mu}_R) +\mathbb{E}(U)(\boldsymbol{c}-\boldsymbol{\mu}_C)^\top(\boldsymbol{r}-\boldsymbol{\mu}_R),

    where \delta=\mathbb{E}(U^2)/4 and \mathbb{E}(U) are the parameter of the latent variables.

  • "General": The latent variables do not have any nice properties:

    d_\mathrm{M}(\boldsymbol{x})^2=(\boldsymbol{c}-\boldsymbol{\mu}_C)^{\top}(\boldsymbol{c}-\boldsymbol{\mu}_C)+(\boldsymbol{r}-\boldsymbol{\mu}_R)^{\top}\boldsymbol{\Delta}(\boldsymbol{r}-\boldsymbol{\mu}_R) +(\boldsymbol{c}-\boldsymbol{\mu}_C)^{\top}\boldsymbol{\Psi}(\boldsymbol{r}-\boldsymbol{\mu}_R),

    where:

    • \boldsymbol{\Psi}=\text{diag}(\mathbb{E}(U_1),\dots,\mathbb{E}(U_p)),

    • \boldsymbol{\Delta}=\text{diag}(\mathbb{E}(U^2_1),\dots,\mathbb{E}(U^2_p))/4.

Value

A vector with the squared Mallows distance of each observation.

References

Oliveira, M. R., Pinheiro, D., & Oliveira, L. (2025). Location and association measures for interval-valued data based on Mallows' distance. arXiv preprint arXiv:2407.05105. https://arxiv.org/abs/2407.05105

Examples

data(creditcard)
credit_card_int <- creditcard$intData

credit_card_dist <- Mallows_dist(credit_card_int)

AIDA documentation built on Nov. 4, 2026, 9:06 a.m.