Learn R Programming

dbrobust (version 1.0.0)

robust_RelMS: Robust RelMS Distance

Description

Computes a robust version of the Gower distance using the RelMS method 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 and combined using the RelMS approach.

Usage

robust_RelMS(data, w, p, robust_cov)

Value

A numeric matrix of squared robust distances normalized by geometric variability.

Arguments

data

Numeric matrix or data frame with all variables combined.

w

Numeric vector of weights for each observation. Will be normalized internally.

p

Integer vector of length 3: c(#cont, #binary, #categorical).

robust_cov

Robust covariance matrix for continuous variables.

Details

The function computes distances separately for continuous, binary, and categorical variables, then applies the RelMS combination procedure. Continuous distances are Mahalanobis distances, categorical distances use a matching coefficient, and binary distances use a modified similarity coefficient. Eigen decomposition is used to compute the square root matrices needed in the RelMS combination.