cstep {robustmatrix}R Documentation

C-step of Matrix Minimum Covariance Determinant (MMCD) Estimator

Description

This function is part of the FastMMCD algorithm (double-blind 2024).

Usage

cstep(
  X,
  alpha = 0.5,
  h_init = -1L,
  init = TRUE,
  max_iter = 100L,
  max_iter_MLE = 100L,
  lambda = 0,
  adapt_alpha = TRUE
)

Arguments

X

a 3d array of dimension (p,q,n)(p,q,n), containing nn matrix-variate samples of pp rows and qq columns in each slice.

alpha

numeric parameter between 0.5 (default) and 1. Controls the size halphanh \approx alpha * n of the h-subset over which the determinant is minimized.

h_init

Integer. Size of initial h-subset. If smaller than 0 (default) size is chosen automatically.

init

Logical. If TRUE (default) elemental subsets are used to initialize the procedure.

max_iter

upper limit of C-step iterations (default is 100)

max_iter_MLE

upper limit of MLE iterations (default is 100)

lambda

a smooting parameter for the rowwise and columnwise covariance matrices.

adapt_alpha

Logical. If TRUE (default) alpha is adapted to take the dimension of the data into account.

Value

A list containing the following:

mu

Estimated p×qp \times q mean matrix.

cov_row

Estimated pp times pp rowwise covariance matrix.

cov_col

Estimated qq times qq columnwise covariance matrix.

cov_row_inv

Inverse of cov_row.

cov_col_inv

Inverse of cov_col.

md

Squared Mahalanobis distances.

md_raw

Squared Mahalanobis distances based on raw MMCD estimators.

det

Value of objective function (determinant of Kronecker product of rowwise and columnwise covariane).

dets

Objective values for the final h-subsets.

h_subset

Final h-subset of raw MMCD estimators.

iterations

Number of C-steps.

See Also

mmcd

Examples

n = 1000; p = 2; q = 3
mu = matrix(rep(0, p*q), nrow = p, ncol = q)
cov_row = matrix(c(1,0.5,0.5,1), 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)
ind <- sample(1:n, 0.3*n)
X[,,ind] <- rmatnorm(n = length(ind), matrix(rep(10, p*q), nrow = p, ncol = q), cov_row, cov_col)
par_mmle <- mmle(X)
par_cstep <- cstep(X)
distances_mmle <- mmd(X, par_mmle$mu, par_mmle$cov_row, par_mmle$cov_col)
distances_cstep <- mmd(X, par_cstep$mu, par_cstep$cov_row, par_cstep$cov_col)
plot(distances_mmle, distances_cstep)
abline(h = qchisq(0.99, p*q), lty = 2, col = "red")
abline(v = qchisq(0.99, p*q), lty = 2, col = "red")

[Package robustmatrix version 0.1.2 Index]