Computes a weighted, robust version of the Gower distance for mixed-type data (continuous, binary, categorical). Continuous variables are handled via a robust Mahalanobis distance using a supplied robust covariance matrix. Binary and categorical variables are transformed into distances via similarity coefficients.
robust_ggower(data, w, p, robust_cov)A numeric matrix of squared robust Gower distances, normalized by geometric variability.
Numeric matrix or data frame with all variables combined.
Numeric vector of weights for each observation. Will be normalized internally.
Integer vector of length 3: c(#cont, #binary, #categorical).
Robust covariance matrix for continuous variables.
The function computes distances separately for continuous, binary, and categorical variables, then scales each by its geometric variability and combines them. The output is a normalized squared distance matrix suitable for robust clustering or aggregation procedures.
Continuous distances are Mahalanobis distances: \((x-y)^T (S)^-1 (x-y)\). Categorical distances use a matching coefficient. Binary distances are modified to account for positive/negative matches.