View source: R/shapley_interaction.R
shapley_interaction | R Documentation |
The shapley_interaction
function computes a p \times p
matrix
containing pairwise outlyingness scores based on Shapley interaction indices.
It decomposes the squared Mahalanobis distance of x
(with respect to mu
and Sigma
)
into outlyingness contributions of pairs of variables \insertCiteMayrhofer2022ShapleyOutlier.
shapley_interaction(x, mu, Sigma, inverted = FALSE)
x |
Data vector with |
mu |
Either |
Sigma |
Either |
inverted |
Logical. If |
A p \times p
matrix containing the decomposition of the squared Mahalanobis distance of x
into outlyingness scores for pairs of variables with respect to mu
and Sigma
.
Mayrhofer2022ShapleyOutlier
p <- 5
mu <- rep(0,p)
Sigma <- matrix(0.9, p, p); diag(Sigma) = 1
Sigma_inv <- solve(Sigma)
x <- c(0,1,2,2.3,2.5)
shapley_interaction(x, mu, Sigma)
PHI <- shapley_interaction(x, mu, Sigma_inv, inverted = TRUE)
plot(PHI)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.