| locOuts | R Documentation |
Identifies local multivariate outliers using spatially smoothed robust covariance estimation (ssMRCD) as proposed by Puchhammer and Filzmoser (2023). For each observation, the Mahalanobis distance to its nearest neighbor is computed, and an adjusted boxplot is used to detect outliers.
locOuts(data, coords, groups, lambda, weights = NULL, k = NULL, dist = NULL)
data |
A numeric matrix of observations (rows = observations, columns = variables). |
coords |
A numeric matrix of spatial coordinates corresponding to the observations. |
groups |
A vector assigning each observation to a neighborhood/group. |
lambda |
Smoothing parameter for the |
weights |
Optional weighting matrix for spatial smoothing. If omitted, inverse-distance weights are computed automatically. |
k |
Integer. Number of nearest neighbors to use if |
dist |
Numeric. Use neighbors within this distance instead of |
An object of class "locOuts" containing:
outliersIndices of detected outliers.
next_distanceVector of Mahalanobis next distances (min distance to neighbors).
cutoffUpper fence of the adjusted boxplot used as outlier threshold.
coordsMatrix of observation coordinates.
dataOriginal data matrix.
groupsGroup assignments.
k, distNeighborhood comparison parameters used.
centersNCenters of neighborhoods.
matneighborBinary matrix indicating which neighbors were used for each observation.
ssMRCDThe fitted ssMRCD object.
Puchhammer, P. and Filzmoser, P. (2023). Spatially Smoothed Robust Covariance Estimation for Local Outlier Detection. *Journal of Computational and Graphical Statistics*, 33(3), 928–940. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10618600.2023.2277875")}
ssMRCD, plot.locOuts
data <- matrix(rnorm(2000), ncol = 4)
coords <- matrix(runif(1000), ncol = 2)
groups <- sample(1:10, 500, replace = TRUE)
result <- locOuts(data, coords, groups, lambda = 0.3, k = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.