cellMGGMM: Calculation of the cellwise robust multi-group Gaussian...

View source: R/cellMGGMM.R

cellMGGMMR Documentation

Calculation of the cellwise robust multi-group Gaussian mixture model

Description

Performs robust estimation of multivariate location and scatter within predefined groups using an iiterative EM-based algorithm.

Usage

cellMGGMM(
  X,
  groups,
  alpha = 0.5,
  hperc = 0.75,
  nsteps = 100,
  crit = 1e-04,
  silent = TRUE,
  maxcond = 100
)

Arguments

X

A numeric matrix or data frame with observations in rows and variables in columns.

groups

A vector indicating the group membership for each observation (length must match 'nrow(X)').

alpha

A non-negative numeric value between '0.5' and '1' controlling the flexibility degree. Default is '0.5'.

hperc

A numeric value in '[0,1]' controlling robustness of the estimation. Default is '0.75'.

nsteps

Number of main iteration steps in the algorithm. Default is '100'.

crit

Convergence criterion for iterative updates. Default is '1e-4'.

silent

Logical; if 'TRUE', suppresses progress output. Default is 'FALSE'.

maxcond

Maximum allowed condition number for covariance matrices. Default is '100'.

Value

A list containing:

X

The original data matrix.

Ximp

The imputed and/or scaled data matrix.

groups

Vector specifying group assignments from the input.

class

Vector indicating the most likely group membership for each observation, as inferred by the model.

mu

A list of estimated location (mean) vectors for each group.

Sigma

A list of estimated covariance matrices for each group.

Sigmai

A list of estimated inverse covariance matrices for each group.

probs

A matrix of class probabilities for each observation (rows = observations, columns = groups).

pi_groups

A matrix of estimated mixture probabilities, where rows correspond to groups and columns to distributions.

W

A binary matrix indicating outlying cells (0 = outlier, 1 = no outlier).

Q

A matrix of penalty weights.

Sigma_reg

A list of estimated target (regularization) matrices.

rho

A vector of regularization factors used in the estimation.

alpha

Flexibility parameter, as provided in the function input.

hperc

A matrix or vector indicating the percentage of outlying cells per variable and group, based on input.

nsteps

The number of iteration steps taken until convergence.

objvals

The values of the objective function across the iteration steps.

References

Puchhammer, P., Wilms, I., & Filzmoser, P. (2025). A smooth multi-group Gaussian Mixture Model for cellwise robust covariance estimation. ArXiv preprint \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2504.02547")}.

See Also

residuals_mggmm

Examples

data("weatherAUT2021")
cut_lon = c(min(weatherAUT2021$lon)-0.2, 12, 16, max(weatherAUT2021$lon) + 0.2)
cut_lat = c(min(weatherAUT2021$lat)-0.2, 48, max(weatherAUT2021$lat) + 0.2)
groups = groups_gridbased(weatherAUT2021$lon, weatherAUT2021$lat, cut_lon, cut_lat)
N = length(unique(groups))
model = cellMGGMM(X = weatherAUT2021[, c("p", "s", "vv", "t", "rsum", "rel")],
                 groups = groups,
                 alpha = 0.5)

ssMRCD documentation built on Nov. 5, 2025, 7:44 p.m.