Calculate the squared Interval-Mahalanobis distance of all rows in the data and the barycenter.
Arguments
- data
An
intDataobject containing the macrodata/interval data- z
(Optional) A vector of 0 and 1, indicating which observations should be considered for the calculation. If
zis notNULL,mean_c,mean_r, andcovwill be computed using only the observations withz=1(seeint_mean_zandint_cov_z). Defaults toNULL.- mean_c
(Optional) A vector specifying the mean of centers. Defaults to
NULL, in which case it will be computed using theIMCDfunction, ifzis alsoNULL.- mean_r
(Optional) A vector specifying the mean of ranges. Defaults to
NULL, in which case it will be computed using theIMCDfunction, ifzis alsoNULL.- cov
(Optional) A covariance matrix. Defaults to
NULL, in which case it will be computed using theIMCDfunction, ifzis alsoNULL.
Details
The squared Interval-Mahalanobis distance between \(\boldsymbol{x}=(\boldsymbol{c}^\top,\boldsymbol{r}^\top)^\top\) and the barycenter \(\boldsymbol{\mu}_B=(\boldsymbol{\mu}_C^\top,\boldsymbol{\mu}_R^\top)^\top\) of a population with symbolic covariance matrix \(\boldsymbol{\Sigma}_B\) (see int_cov) is defined according to the LatentCase:
"U_id_symmetric": The latent variables are identically distributed and symmetric: $$d_\mathrm{IMah}(\boldsymbol{x})^2=(\boldsymbol{c}-\boldsymbol{\mu}_C)^{\top}\boldsymbol{\Sigma}_{B}^{-1}(\boldsymbol{c}-\boldsymbol{\mu}_C)+\delta(\boldsymbol{r}-\boldsymbol{\mu}_R)^{\top}\boldsymbol{\Sigma}_{B}^{-1}(\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: $$\begin{aligned} d_\mathrm{IMah}(\boldsymbol{x})^2&=(\boldsymbol{c}-\boldsymbol{\mu}_C)^{\top}\boldsymbol{\Sigma}_{B}^{-1}(\boldsymbol{c}-\boldsymbol{\mu}_C)+\delta(\boldsymbol{r}-\boldsymbol{\mu}_R)^{\top}\boldsymbol{\Sigma}_{B}^{-1}(\boldsymbol{r}-\boldsymbol{\mu}_R)\\ &\quad+\mathbb{E}(U)(\boldsymbol{c}-\boldsymbol{\mu}_C)^\top\boldsymbol{\Sigma}_{B}^{-1}(\boldsymbol{r}-\boldsymbol{\mu}_R), \end{aligned}$$ 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: $$\begin{aligned} d_\mathrm{IMah}(\boldsymbol{x})^2&=(\boldsymbol{c}-\boldsymbol{\mu}_C)^{\top}\boldsymbol{\Sigma}_{B}^{-1}(\boldsymbol{c}-\boldsymbol{\mu}_C)+\dfrac{1}{4}(\boldsymbol{r}-\boldsymbol{\mu}_R)^{\top}\left(\boldsymbol{\mathfrak{E}}_{UU}\bullet\boldsymbol{\Sigma}_{B}^{-1}\right)(\boldsymbol{r}-\boldsymbol{\mu}_R)\\ &\quad+(\boldsymbol{c}-\boldsymbol{\mu}_C)^{\top}\boldsymbol{\Sigma}_{B}^{-1}\boldsymbol{\Psi}(\boldsymbol{r}-\boldsymbol{\mu}_R), \end{aligned}$$ where:\(\boldsymbol{\Psi}=\text{diag}(\mathbb{E}(U_1),\dots,\mathbb{E}(U_p))\),
\([\boldsymbol{\mathfrak{E}}_{UU}]_{j\ell}=\mathcal{E}(U_j,U_\ell)\), \(j\neq \ell\), with \(\mathcal{E}(U_j,U_\ell)=\int_0^1 F_{U_j}^{-1}(t) F_{U_\ell}^{-1}(t) \, dt\),
\([\boldsymbol{\mathfrak{E}}_{UU}]_{jj}=\mathbb{E}(U_j^2)\), \(j,\ell=1,\dots,p\),
\(\bullet\) denotes the Schur (or entrywise) product of matrices.
References
Loureiro, C. P., Oliveira, M. R., Brito, P., & Oliveira, L. (2026). Minimum Covariance Determinant Estimator and Outlier Detection for Interval-valued Data. arXiv preprint arXiv:2604.26769. https://arxiv.org/abs/2604.26769
Examples
data(creditcard)
credit_card_int <- creditcard$intData
# Compute squared Interval-Mahalanobis distance using IMCD estimates of mean and covariance
credit_card_dist <- IMah_dist(credit_card_int)