Estimate the covariance/correlation between columns as the weighted sum of a low rank matrix and a scaled identity matrix. The weight acts to shrink the sample correlation matrix towards the identity matrix or the sample covariance matrix towards a scaled identity matrix with constant variance. An estimate of this form is useful because it is fast, and enables fast operations downstream.
eclairs(
X,
k,
lambda = NULL,
compute = c("covariance", "correlation"),
warmStart = NULL
)
data matrix with n samples as rows and p features as columns
the rank of the low rank component
shrinkage parameter. If not specified, it is estimated from the data.
compute the 'covariance' (default) or 'correlation'
result of previous SVD to initialize values
eclairs object storing:
U: orthonormal matrix with k columns representing the low rank component
dSq: eigen-values so that \(U diag(d^2) U^T\) is the low rank component
lambda: shrinkage parameter \(\lambda\) for the scaled diagonal component
nu: diagonal value, \(\nu\), of target matrix in shrinkage
n: number of samples (i.e. rows) in the original data
p: number of features (i.e. columns) in the original data
k: rank of low rank component
rownames: sample names from the original matrix
colnames: features names from the original matrix
method: method used for decomposition
call: the function call
Compute \(U\), \(d^2\) to approximate the covariance/correlation matrix between columns of data matrix X by \(U diag(d^2 (1-\lambda)) U^T + diag(\nu * \lambda)\). When computing the covariance matrix \(\nu\) is the constant variance which is the mean of all feature-wise variances. When computing the correlation matrix, \(\nu = 1\).