Learn R Programming

ICSOutlier (version 0.4-0)

ics_distances: Squared ICS Distances for Invariant Coordinates

Description

Squared ICS Distances for Invariant Coordinates

Usage

ics_distances(object, index = NULL)

Value

A numeric vector containing the squared ICS distances.

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.

Author

Aurore Archimbaud and Klaus Nordhausen

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.

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. tools:::Rd_expr_doi("10.1016/j.csda.2018.06.011").

See Also

Examples

Run this code
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)

Run the code above in your browser using DataLab