SCD | R Documentation |
The SCD
function indicates outlying cells for
a data vector with p
entries or data matrix with n \times p
entries containing only numeric entries x
for a given center mu
and covariance matrix Sigma
using the Shapley value \insertCiteMayrhofer2022ShapleyOutlier.
SCD(
x,
mu,
Sigma,
Sigma_inv = NULL,
step_size = 0.1,
min_deviation = 0,
max_step = NULL,
max_iter = 1000,
q = 0.99,
method = "cellMCD",
check = TRUE,
cells = NULL
)
x |
Data vector with |
mu |
Either |
Sigma |
Either |
Sigma_inv |
Either |
step_size |
Numeric. Step size for the imputation of outlying cells, with |
min_deviation |
Numeric. Detection threshold, with |
max_step |
Either |
max_iter |
Integer. The maximum number of iterations. |
q |
Numeric. The quantile of the Chi-squared distribution for detection and imputation of outliers. Defaults to |
method |
Either "cellMCD" (default) or "MCD". Specifies the method used for parameter estimation if |
check |
Logical. If |
cells |
Either |
A list of class shapley_algorithm
(new_shapley_algorithm
) containing the following:
x |
A |
phi |
A |
x_original |
A |
x_history |
The path of how the original data vector was modified. |
phi_history |
The Shapley values corresponding to |
S_history |
The indices of the outlying cells in each iteration. |
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)
SCD_x <- SCD(x = x, mu = mu, Sigma = Sigma)
plot(SCD_x)
library(MASS)
set.seed(1)
n <- 100; p <- 10
mu <- rep(0,p)
Sigma <- matrix(0.9, p, p); diag(Sigma) = 1
X <- mvrnorm(n, mu, Sigma)
X[sample(1:(n*p), 100, FALSE)] <- rep(c(-5,5),50)
SCD_X <- SCD(X, mu, Sigma)
plot(SCD_X, subset = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.