ssMRCD {ssMRCD} | R Documentation |
Spatially Smoothed MRCD Estimator
Description
The ssMRCD function calculates the spatially smoothed MRCD estimator from Puchhammer and Filzmoser (2023).
Usage
ssMRCD(
x,
weights,
lambda,
TM = NULL,
alpha = 0.75,
maxcond = 50,
maxcsteps = 200,
n_initialhsets = NULL
)
Arguments
x |
a list of matrices containing the observations per neighborhood sorted which can be obtained by the function |
weights |
weighting matrix, symmetrical, rows sum up to one and diagonals need to be zero (see also |
lambda |
numeric between 0 and 1. |
TM |
target matrix (optional), default value is the covMcd from robustbase. |
alpha |
numeric, proportion of values included, between 0.5 and 1. |
maxcond |
optional, maximal condition number used for rho-estimation. |
maxcsteps |
maximal number of c-steps before algorithm stops. |
n_initialhsets |
number of initial h-sets, default is 6 times number of neighborhoods. |
Value
An object of class "ssMRCD"
containing the following elements:
MRCDcov | List of ssMRCD-covariance matrices sorted by neighborhood. |
MRCDicov | List of inverse ssMRCD-covariance matrices sorted by neighborhood. |
MRCDmu | List of ssMRCD-mean vectors sorted by neighborhood. |
mX | List of data matrices sorted by neighborhood. |
N | Number of neighborhoods. |
mT | Target matrix. |
rho | Vector of regularization values sorted by neighborhood. |
alpha | Scalar what percentage of observations should be used. |
h | Vector of how many observations are used per neighborhood, sorted. |
numiter | The number of iterations for the best initial h-set combination. |
c_alpha | Consistency factor for normality. |
weights | The weighting matrix. |
lambda | Smoothing factor. |
obj_fun_values | A matrix with objective function values for all initial h-set combinations (rows) and iterations (columns). |
best6pack | initial h-set combinations with best objective function value after c-step iterations. |
Kcov | returns MRCD-estimates without smoothing. |
References
Puchhammer P. and Filzmoser P. (2023): Spatially smoothed robust covariance estimation for local outlier detection. doi:10.48550/arXiv.2305.05371
See Also
plot.ssMRCD, summary.ssMRCD, restructure_as_list
Examples
# create data set
x1 = matrix(runif(200), ncol = 2)
x2 = matrix(rnorm(200), ncol = 2)
x = list(x1, x2)
# create weighting matrix
W = matrix(c(0, 1, 1, 0), ncol = 2)
# calculate ssMRCD
ssMRCD(x, weights = W, lambda = 0.5)