View source: R/ics.distances.R
ics.distances | R Documentation |
Computes the squared ICS distances, defined as the Euclidian distances of the selected centered components.
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 ics2
).
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 Mahlanobis distances computed with
respect of the first scatter and associated location specified in S1
.
A numeric vector containing the squared ICS distances.
Function ics.distances()
reached the end of its lifecycle, please use ics_distances
instead. In future versions, ics_distances()
will be deprecated and eventually removed.
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. <https://doi.org/10.1016/j.csda.2018.06.011>.
ics2
, 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 <- ics2(X)
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.