View source: R/ics.distances.R
ics_distances | R Documentation |
Squared ICS Distances for Invariant Coordinates
ics_distances(object, index = NULL)
object |
object of class |
index |
vector of integers indicating the indices of the components to select. |
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
.
A numeric vector containing the squared ICS distances.
Aurore Archimbaud and Klaus Nordhausen
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")}.
ICS(), mahalanobis()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.