# ics_distances: Squared ICS Distances for Invariant Coordinates In ICSOutlier: Outlier Detection Using Invariant Coordinate Selection

 ics_distances R Documentation

## Squared ICS Distances for Invariant Coordinates

### Description

Squared ICS Distances for Invariant Coordinates

### Usage

``````ics_distances(object, index = NULL)
``````

### Arguments

 `object` object of class `"ICS"` where both `S1` and `S2` are specified as functions. `index` vector of integers indicating the indices of the components to select.

### Details

For outlier detection, the squared ICS distances can be used as a measure of outlierness. Denote as `Z` the invariant coordinates centered with the location estimate specified in `S1` (for details see ICS()). Let `Z_k` be the `k` components of `Z` selected by `index`, then the ICS distance of the observation `i` is defined as:

`ICSD^2(x_i,k) = || Z_k||^2.`

Note that if all components are selected, the ICS distances are equivalent to the Mahalanobis distances computed with respect of the first scatter and associated location specified in `S1`.

### Value

A numeric vector containing the squared ICS distances.

### Author(s)

Aurore Archimbaud and Klaus Nordhausen

### References

Archimbaud, A., Nordhausen, K. and Ruiz-Gazen, A. (2018), ICS for multivariate outlier detection with application to quality control. Computational Statistics & Data Analysis, 128:184-199. ISSN 0167-9473. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.csda.2018.06.011")}.

### See Also

ICS(), `mahalanobis()`

### Examples

``````Z <- rmvnorm(1000, rep(0, 6))
Z[1:20, 1] <- Z[1:20, 1] + 5
A <- matrix(rnorm(36), ncol = 6)
X <- tcrossprod(Z, A)

pairs(X)
icsX <- ICS(X, center = TRUE)

icsX.dist.all <- ics_distances(icsX, index = 1:6)
maha <- mahalanobis(X, center = colMeans(X), cov = cov(X))
# in this case the distances should be the same
plot(icsX.dist.all, maha)
all.equal(icsX.dist.all, maha)

icsX.dist.first <- ics_distances(icsX, index = 1)
plot(icsX.dist.first)
``````

ICSOutlier documentation built on May 29, 2024, 2:08 a.m.