ID 772991
Date 3/31/2023
Public

## Performing Robust Estimation of a Variance-Covariance Matrix

Use the Translated Biweight S-estimator (TBS) method to perform robust estimation of a variance-covariance matrix and mean vector [Rocke96]. The start point of the algorithm is computed using a single iteration of the Maronna algorithm with the reweighting step [Marrona2002]. The parameters of the TBS algorithm are packed into the params array. A pointer to this array along with other required parameters is passed to the task descriptor using the EditRobustCovariance editor. The structure of the params array is available in Table Structure of the Array of TBS Parameters in the Summary Statistics section of [MKLMan].

The algorithm outputs a robust variance-covariance matrix and the mean vector. The following example illustrates computation of a robust estimation for the variance-covariance matrix with the help of the TBS estimator:

#include "mkl_vsl.h"

#define DIM   10   /* dimension of the task */
#define N   1000   /* number of observations */

int main()
{
double x[DIM][N];  /* matrix of observations */
double params[VSL_SS_TBS_PARAMS_N];
double rcov[DIM*(DIM+1)/2], rmean[DIM];
MKL_INT nparams, xstorage, rcovstorage;
MKL_INT p, n;
int status;

double breakdown, alpha, sigma, max_iter;

/* Parameters of the task and initialization */
p = DIM;
n = N;
xstorage    = VSL_SS_MATRIX_STORAGE_ROWS;
rcovstorage = VSL_SS_MATRIX_STORAGE_U_PACKED;
nparams     = VSL_SS_TBS_PARAMS_N; /* number of TBS parameters */

/* Parameters of the TBS estimator */
breakdown = 0.3;
alpha = 0.01;
sigma = 0.01;
max_iter = 30;

params[0] = breakdown;
params[1] = alpha;
params[2] = sigma;
params[3] = max_iter;

/* Initialize the task parameters */
&nparams, params, rmean, rcov );

/* Compute the robust variance-covariance matrix */
status = vsldSSCompute( task, VSL_SS_ROBUST_COV, VSL_SS_METHOD_TBS );

/* Deallocate the task resources */