View source: R/select_parameters.R
select_smoothing | R Documentation |
The optimal smoothing value for the ssMRCD estimator is based on the residuals and the trimmed mean of the norm.
select_smoothing(
X,
groups,
weights,
lambda = seq(0, 1, 0.1),
TM = NULL,
alpha = 0.75,
seed = 123436,
return_all = TRUE,
cores = 1
)
X |
data matrix containing observations. |
groups |
grouping vector corresponding to |
weights |
weight matrix for groups, see |
lambda |
vector of parameter values for smoothing, between 0 and 1. |
TM |
target matrix, if not given MCD (or MRCD if non regular) is used with default values and |
alpha |
percentage of outliers to be expected. |
seed |
seed for ssMRCD calculations. |
return_all |
logical, if FALSE the function returns only the optimal lambda. |
cores |
integer, number of cores used for parallel computing. |
lambda_opt | optimal lambda for smoothing. |
COVS | ssMRCD object with optimal parameter setting. |
plot | plot for optimal parameter setting. |
residuals | mean of norm of residuals for varying lambda. |
# create data set
x1 = matrix(runif(200), ncol = 2)
x2 = matrix(rnorm(200), ncol = 2)
# create weighting matrix
W = matrix(c(0, 1, 1, 0), ncol = 2)
select_smoothing (X = rbind(x1, x2),
groups = rep(c(1,2), each = 100),
weights = W,
lambda = seq(0, 1, 0.1),
return_all = TRUE,
cores = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.