matrixShapley {robustmatrix} | R Documentation |
Outlier explanation based on Shapley values for matrix-variate data
Description
matrixShapley
decomposes the squared matrix Mahalanobis distance (mmd
) into additive outlyingness contributions of
the rows, columns, or cell of a matrix (Mayrhofer and Filzmoser 2023; double-blind 2024).
Usage
matrixShapley(X, mu = NULL, cov_row, cov_col, inverted = FALSE, type = "cell")
Arguments
X |
a 3d array of dimension |
mu |
a |
cov_row |
a |
cov_col |
a |
inverted |
Logical. FALSE by default.
If TRUE |
type |
Character. Either "row", "col", or "cell" (default) to compute rowwise, columnwise, or cellwise Shapley values. |
Value
Rowwise, columnwise, or cellwise Shapley value(s).
References
Mayrhofer M, Filzmoser P (2023).
“Multivariate outlier explanations using Shapley values and Mahalanobis distances.”
Econometrics and Statistics.
double-blind (2024).
“Robust covariance estimation and explainable outlier detection for matrix-valued data.”
[Manuscript submitted for publication].
See Also
mmd
.
Examples
n = 1000; p = 2; q = 3
mu = matrix(rep(0, p*q), nrow = p, ncol = q)
cov_row = matrix(c(5,2,2,4), nrow = p, ncol = p)
cov_col = matrix(c(3,2,1,2,3,2,1,2,3), nrow = q, ncol = q)
X <- rmatnorm(n = 1000, mu, cov_row, cov_col)
distances <- mmd(X, mu, cov_row, cov_col)