View source: R/int_distances.r
| IMah_dist | R Documentation |
Calculate the squared Interval-Mahalanobis distance of all rows in the data and the barycenter.
IMah_dist(
data,
z = NULL,
mean_c = NULL,
mean_r = NULL,
cov = NULL,
mean = NULL
)
data |
An |
z |
(Optional) A vector of 0 and 1, indicating which observations should be considered for the calculation.
If |
mean_c |
(Optional) A vector specifying the mean of centers. Defaults to |
mean_r |
(Optional) A vector specifying the mean of ranges. Defaults to |
cov |
(Optional) A covariance matrix. Defaults to |
mean |
(Optional) An |
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.
A vector with the squared Interval-Mahalanobis distance of each observation.
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
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)
# Compute non-robust squared Interval-Mahalanobis distance using sample mean and covariance
credit_card_dist_nonrobust <- IMah_dist(credit_card_int, z = rep(1, credit_card_int@NObs))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.