FrederickHuangLin / ANCOMBC

Differential abundance (DA) and correlation analyses for microbial absolute abundance data
https://www.nature.com/articles/s41467-020-17041-7
108 stars 29 forks source link

Regularization of covariance matrix by winsorizing the eigenvalues #292

Open FarnazFouladi opened 3 weeks ago

FarnazFouladi commented 3 weeks ago

This commit includes regularization of covariance matrix. The function "regularize_eigenvalues" was added to utils.R This function winsorizes very small eigenvalues to a value between 0.1-1. This value is chosen based on the ratio of eigenvalues to the largest eigenvalue. Using this function, the covariance matrix is regularized at lines 80-104 of the script sparse_linear.R. The regularized covariance matrix is returned as a stand-alone output and is included in the list of outputs at line 157.