compute_cov_cor: Compute the Robust Covariance and Correlation Matrix of A...

View source: R/utils.R

compute_cov_corR Documentation

Compute the Robust Covariance and Correlation Matrix of A Numeric Matrix

Description

Compute the robust covariance and correlation matrix of a numeric matrix. The function is used to check whether S_r != S_r_tilda and R_r == R_r_tilda?

Usage

compute_cov_cor(x, control)

Arguments

x

A numeric matrix or an object that can be coerced to a numeric matrix.

control

A control object (S4) for one of the available control classes, e.g. CovControlMcd-class, CovControlOgk-class, CovControlSest-class, etc., containing estimation options. The class of this object defines which estimator will be used. Alternatively a character string can be specified which names the estimator - one of auto, sde, mcd, ogk, m, mve, sfast, surreal, bisquare, rocke. If "auto" is specified or the argument is missing, the function will select the estimator.

Value

A list with the following components:

S_r

The robust covariance matrix of cov_x.

S_r_tilda

The robust covariance matrix of cov_scale_x.

R_r

The robust correlation matrix of cov_x.

R_r_tilda

The robust correlation matrix of cov_scale_x.

cov_x = rrcov::CovRobust(x = x, control = control) cov_scale_x = rrcov::CovRobust(x = scale(x), control = control)

Author(s)

Ying-Ying Zhang (Robert) robertzhangyying@qq.com

References

Zhang, Y. Y. (2013), An Object Oriented Solution for Robust Factor Analysis.

Examples

data("hbk")
hbk.x = hbk[,1:3]

compute_cov_cor(x = hbk.x, control = "mcd")


robustfa documentation built on April 16, 2023, 5:18 p.m.